org.ow2.petals.binding.soap
Class SoapComponentContext

java.lang.Object
  extended by org.ow2.petals.binding.soap.SoapComponentContext

public class SoapComponentContext
extends Object

The SOAP component context. The context is filled by the SU listener (adding modules, service descriptions...) and used by the listeners/workers.

Author:
Christophe HAMERLING (chamerling) - eBMWebSourcing

Nested Class Summary
static class SoapComponentContext.ServiceManager<E>
           
 
Constructor Summary
SoapComponentContext(javax.jbi.component.ComponentContext context, org.ow2.petals.component.framework.jbidescriptor.generated.Component componentConfiguration, org.ow2.petals.probes.KeyedGaugeProbe<ServiceClientKey,Integer,Integer> probeWsClientPoolClientsInUse, org.ow2.petals.probes.KeyedCounterProbe<ServiceClientKey> probeWsClientPoolExhaustions, org.ow2.petals.probes.KeyedCounterProbeWithExecutionStatus<ServiceClientKey> probeWsRequestsInvocationsCount, org.ow2.petals.probes.KeyedResponseTimeProbe<ServiceClientKey> probeWsClientInvocationsResponseTime, Logger logger)
          Creates a new instance of SoapComponentContext
 
Method Summary
 void addJbiDescriptor(String serviceUnitName, org.ow2.petals.component.framework.jbidescriptor.generated.Jbi jbiDescriptor)
          Add a JBIDescriptor
 void addServiceDescriptor(String serviceUnitName, File serviceDescriptor)
          Add a JBIDescriptor
 PetalsServiceClient borrowServiceClient(String address, QName operation, String soapAction, URI mep, org.ow2.petals.component.framework.api.configuration.ConfigurationExtensions cdkExtensions, org.ow2.petals.component.framework.jbidescriptor.generated.Provides provides, String rampartUserName)
           Get a service client associated to an axis service set with the good operation.
 void deleteServiceClientPools(org.ow2.petals.component.framework.jbidescriptor.generated.Provides provides)
          Delete all the service client pools which used the provides instance
 org.apache.axis2.context.ConfigurationContext getAxis2ConfigurationContext()
           
 org.ow2.petals.component.framework.jbidescriptor.generated.Component getComponentConfiguration()
           
 SoapComponentContext.ServiceManager<org.ow2.petals.component.framework.jbidescriptor.generated.Consumes> getConsumersManager()
           
 org.ow2.petals.component.framework.jbidescriptor.generated.Jbi getJbiDescriptor(String serviceUnitName)
          Get the JBI descriptor for the given address.
 String getJmsConnectionFactoryName()
          The connection factory JNDI name used by the JMS transport layer.
 String getJmsJndiInitialFactory()
          The JNDI initial factory used by the JMS transport layer.
 String getJmsJndiProviderUrl()
          The JNDI provider URL used by the JMS transport layer.
 org.ow2.petals.probes.KeyedResponseTimeProbe<ServiceClientKey> getProbeWsClientInvocationsResponseTime()
           
 org.ow2.petals.probes.KeyedGaugeProbe<ServiceClientKey,Integer,Integer> getProbeWsClientPoolClientsInUse()
           
 org.ow2.petals.probes.KeyedCounterProbe<ServiceClientKey> getProbeWsClientPoolExhaustions()
           
 org.ow2.petals.probes.KeyedCounterProbeWithExecutionStatus<ServiceClientKey> getProbeWsRequestsInvocationsCount()
           
 SoapComponentContext.ServiceManager<org.ow2.petals.component.framework.jbidescriptor.generated.Provides> getProvidersManager()
           
 Map<ServiceClientKey,org.apache.commons.pool.impl.GenericObjectPool<PetalsServiceClient>> getServiceClientPools()
           
 File getServiceDescriptor(String serviceUnitName)
          Get the service descriptor as File of the given service unit if available.
protected  int getWsClientMaxPoolSize()
           
 void removeJbiDescriptor(String serviceUnitName)
          Remove the JBIDescriptor for the given address
 void removeServiceDescriptor(String serviceUnitName)
          Remove the JBIDescriptor for the given service unit
 void returnServiceClient(String address, QName operation, URI mep, PetalsServiceClient petalsServiceClient, String soapAction)
          Release the service client to the pool
 void setAxis2ConfigurationContext(org.apache.axis2.context.ConfigurationContext axis2ConfigurationContext)
           
 void setComponentConfiguration(org.ow2.petals.component.framework.jbidescriptor.generated.Component componentConfiguration)
           
 void setJmsConnectionFactoryName(String jmsConnectionFactoryName)
          Set the connection factory JNDI name used by the JMS transport layer.
 void setJmsJndiInitialFactory(String jmsJndiInitialFactory)
          Set the JNDI initial factory used by the JMS transport layer.
 void setJmsJndiProviderUrl(String jmsJndiProviderUrl)
          Set the JNDI provider URL used by the JMS transport layer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SoapComponentContext

public SoapComponentContext(javax.jbi.component.ComponentContext context,
                            org.ow2.petals.component.framework.jbidescriptor.generated.Component componentConfiguration,
                            org.ow2.petals.probes.KeyedGaugeProbe<ServiceClientKey,Integer,Integer> probeWsClientPoolClientsInUse,
                            org.ow2.petals.probes.KeyedCounterProbe<ServiceClientKey> probeWsClientPoolExhaustions,
                            org.ow2.petals.probes.KeyedCounterProbeWithExecutionStatus<ServiceClientKey> probeWsRequestsInvocationsCount,
                            org.ow2.petals.probes.KeyedResponseTimeProbe<ServiceClientKey> probeWsClientInvocationsResponseTime,
                            Logger logger)
Creates a new instance of SoapComponentContext

Parameters:
context -
componentConfiguration -
probeWsClientPoolClientsInUse - The probe counting allocated ws-clients in the pool.
probeWsClientPoolExhaustions - The probe counting the number of ws-client pool exhaustions.
probeWsRequestsInvocationsCount - The probe counting external web-service invocation by web-service, web-service operation and MEP.
probeWsClientInvocationsResponseTime - The probe measuring the response time of WS client invocation by external web-service, operation, MEP and execution status.
logger -
Method Detail

addJbiDescriptor

public void addJbiDescriptor(String serviceUnitName,
                             org.ow2.petals.component.framework.jbidescriptor.generated.Jbi jbiDescriptor)
Add a JBIDescriptor

Parameters:
address -
jbiDescriptor -

addServiceDescriptor

public void addServiceDescriptor(String serviceUnitName,
                                 File serviceDescriptor)
Add a JBIDescriptor

Parameters:
address -
jbiDescriptor -

borrowServiceClient

public PetalsServiceClient borrowServiceClient(String address,
                                               QName operation,
                                               String soapAction,
                                               URI mep,
                                               org.ow2.petals.component.framework.api.configuration.ConfigurationExtensions cdkExtensions,
                                               org.ow2.petals.component.framework.jbidescriptor.generated.Provides provides,
                                               String rampartUserName)
                                        throws NoSuchElementException,
                                               javax.jbi.messaging.MessagingException

Get a service client associated to an axis service set with the good operation. It is taken from a pool object.

This service client must be returned to the pool after usage using API: #returnServiceClient(String, QName, URI, PetalsServiceClient) .

Parameters:
address - the address of the service, mainly used as key to retrieve the associated SU.
operation - the target operation QName. Non null
mep - the message exchange pattern used. Non null
cdkExtensions - SU extensions used by the service client pool when the creation of a service client is needed
provides - the provides block of the endpoint which is creating the external WS call
ramprtUserName -
Returns:
a ServiceClient. Not null. Must be returned to the pool after usage using API: #returnServiceClient(String, QName, URI, PetalsServiceClient)
Throws:
NoSuchElementException - The web-service client pool is exhausted.
javax.jbi.messaging.MessagingException

getAxis2ConfigurationContext

public org.apache.axis2.context.ConfigurationContext getAxis2ConfigurationContext()
Returns:
the axis2ConfigurationContext

getComponentConfiguration

public org.ow2.petals.component.framework.jbidescriptor.generated.Component getComponentConfiguration()
Returns:

getConsumersManager

public SoapComponentContext.ServiceManager<org.ow2.petals.component.framework.jbidescriptor.generated.Consumes> getConsumersManager()
Returns:
the consumersManager

getJbiDescriptor

public org.ow2.petals.component.framework.jbidescriptor.generated.Jbi getJbiDescriptor(String serviceUnitName)
Get the JBI descriptor for the given address.

Parameters:
address -
Returns:
the JBIDescriptor if found, else return null

getJmsConnectionFactoryName

public String getJmsConnectionFactoryName()
The connection factory JNDI name used by the JMS transport layer.

Returns:
The connection factory JNDI name used by the JMS transport layer.

getJmsJndiInitialFactory

public String getJmsJndiInitialFactory()
The JNDI initial factory used by the JMS transport layer.

Returns:
The JNDI initial factory used by the JMS transport layer.

getJmsJndiProviderUrl

public String getJmsJndiProviderUrl()
The JNDI provider URL used by the JMS transport layer.

Returns:
The JNDI provider URL used by the JMS transport layer.

getProvidersManager

public SoapComponentContext.ServiceManager<org.ow2.petals.component.framework.jbidescriptor.generated.Provides> getProvidersManager()
Returns:
the providersManager

getServiceDescriptor

public File getServiceDescriptor(String serviceUnitName)
Get the service descriptor as File of the given service unit if available.

Parameters:
address -
Returns:
the file (services.xml) or null if no service descriptor is available

removeJbiDescriptor

public void removeJbiDescriptor(String serviceUnitName)
Remove the JBIDescriptor for the given address

Parameters:
address -

removeServiceDescriptor

public void removeServiceDescriptor(String serviceUnitName)
Remove the JBIDescriptor for the given service unit

Parameters:
address -

deleteServiceClientPools

public void deleteServiceClientPools(org.ow2.petals.component.framework.jbidescriptor.generated.Provides provides)
Delete all the service client pools which used the provides instance

Parameters:
provides -

returnServiceClient

public void returnServiceClient(String address,
                                QName operation,
                                URI mep,
                                PetalsServiceClient petalsServiceClient,
                                String soapAction)
                         throws javax.jbi.messaging.MessagingException
Release the service client to the pool

Parameters:
address -
operation -
mep -
petalsServiceClient -
Throws:
javax.jbi.messaging.MessagingException

setAxis2ConfigurationContext

public void setAxis2ConfigurationContext(org.apache.axis2.context.ConfigurationContext axis2ConfigurationContext)
Parameters:
axis2ConfigurationContext - the axis2ConfigurationContext to set

setComponentConfiguration

public void setComponentConfiguration(org.ow2.petals.component.framework.jbidescriptor.generated.Component componentConfiguration)
Parameters:
componentConfiguration -

setJmsConnectionFactoryName

public void setJmsConnectionFactoryName(String jmsConnectionFactoryName)
Set the connection factory JNDI name used by the JMS transport layer.

Parameters:
jmsConnectionFactoryName - The connection factory JNDI name used by the JMS transport layer.

setJmsJndiInitialFactory

public void setJmsJndiInitialFactory(String jmsJndiInitialFactory)
Set the JNDI initial factory used by the JMS transport layer.

Parameters:
jmsJndiInitialFactory - The JNDI initial factory used by the JMS transport layer.

setJmsJndiProviderUrl

public void setJmsJndiProviderUrl(String jmsJndiProviderUrl)
Set the JNDI provider URL used by the JMS transport layer.

Parameters:
jmsJndiProviderUrl - The JNDI provider URL used by the JMS transport layer.

getWsClientMaxPoolSize

protected int getWsClientMaxPoolSize()
Returns:
The max size of the web-service client pools

getServiceClientPools

public Map<ServiceClientKey,org.apache.commons.pool.impl.GenericObjectPool<PetalsServiceClient>> getServiceClientPools()

getProbeWsRequestsInvocationsCount

public org.ow2.petals.probes.KeyedCounterProbeWithExecutionStatus<ServiceClientKey> getProbeWsRequestsInvocationsCount()
Returns:
The probe counting external web-service invocation by web-service, web-service operation and MEP.

getProbeWsClientPoolClientsInUse

public final org.ow2.petals.probes.KeyedGaugeProbe<ServiceClientKey,Integer,Integer> getProbeWsClientPoolClientsInUse()
Returns:
The probe counting allocated ws-clients in the pool.

getProbeWsClientPoolExhaustions

public final org.ow2.petals.probes.KeyedCounterProbe<ServiceClientKey> getProbeWsClientPoolExhaustions()
Returns:
The probe counting the number of ws-client pool exhaustions.

getProbeWsClientInvocationsResponseTime

public org.ow2.petals.probes.KeyedResponseTimeProbe<ServiceClientKey> getProbeWsClientInvocationsResponseTime()
Returns:
The probe measuring the response time of WS client invocation by external web-service, operation, MEP and execution status.


Copyright © 2005-2012 Petals Link (EBM Websourcing). All Rights Reserved.