it.imolinfo.jbi4corba.jbi.endpoint
Class ConsumerEndpoint

java.lang.Object
  extended by it.imolinfo.jbi4corba.jbi.endpoint.Jbi4CorbaEndpoint
      extended by it.imolinfo.jbi4corba.jbi.endpoint.ConsumerEndpoint
All Implemented Interfaces:
Serializable

public class ConsumerEndpoint
extends Jbi4CorbaEndpoint

The Consumer Endpoint implementation class.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class it.imolinfo.jbi4corba.jbi.endpoint.Jbi4CorbaEndpoint
RUNNING, SHUTDOWN, STOPPED
 
Constructor Summary
ConsumerEndpoint(QName serviceName, String endpointName, ConsumerServiceDescriptor consumerServiceDescriptor)
           
 
Method Summary
 void activate()
          Registers the service and starts the ORB.
protected static void addOperationToWsdlBinding(javax.wsdl.Definition wsdl, javax.wsdl.PortType portType, javax.wsdl.Binding wsdlBinding)
          If there isn't the concrete part of the wsdl we must construct it using the abstract part and this method adds the 'operations' in the PortType to the binding.
protected static javax.wsdl.Definition addSOAPExtensionsToWSDL(javax.wsdl.Definition def)
          Adds SOAP extensions to wsdl.
 void deactivate()
          Override.
protected static javax.wsdl.PortType findFirstPortType(javax.wsdl.Definition def)
          This method find the first PortType in the definition.
 ConsumerServiceDescriptor getConsumerServiceDescriptor()
          Getter.
 ExchangeProcessor getProcessor()
          Override.
 javax.jbi.messaging.MessageExchange.Role getRole()
          Gets the provider role.
 void registerService()
          this method has the following flow.
protected  javax.jbi.servicedesc.ServiceEndpoint retrieveProxiedEndpointDefinition()
          Create a wsdl definition for a consumer endpoint.
 void sendAsynch(javax.jbi.messaging.MessageExchange me, javax.jbi.messaging.DeliveryChannel channel)
          This method is used to send asynchronously a MessageExchange.
 void setConsumerServiceDescriptor(ConsumerServiceDescriptor consumerServiceDescriptor)
          Setter.
 void unregisterService()
          Unregisters the service.
 void validate()
          Validate the endpoint.
 
Methods inherited from class it.imolinfo.jbi4corba.jbi.endpoint.Jbi4CorbaEndpoint
equals, getDefinition, getEndpointName, getEndpointStatus, getEndpointWSDL, getExchangeProcessor, getServiceDescription, getServiceEndpoint, getServiceName, getState, getSuManager, getSuName, getUniqueName, getUniqueName, hashCode, setDefinition, setEndpointStatus, setEndpointWSDL, setExchangeProcessor, setServiceDescription, setServiceEndpoint, setState, setSuManager, setSuName, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConsumerEndpoint

public ConsumerEndpoint(QName serviceName,
                        String endpointName,
                        ConsumerServiceDescriptor consumerServiceDescriptor)
Parameters:
consumerServiceDescriptor - The consumer service descriptor
Method Detail

activate

public void activate()
              throws Jbi4CorbaException
Registers the service and starts the ORB.

Specified by:
activate in class Jbi4CorbaEndpoint
Throws:
Exception - The exception
Jbi4CorbaException

sendAsynch

public void sendAsynch(javax.jbi.messaging.MessageExchange me,
                       javax.jbi.messaging.DeliveryChannel channel)
                throws javax.jbi.messaging.MessagingException
This method is used to send asynchronously a MessageExchange.

Parameters:
me - The MessageExchange.
channel - Used to send directly the ME if the Endpoint is an Active Consumer.
Throws:
javax.jbi.messaging.MessagingException - Sending operation failure.

deactivate

public void deactivate()
Override.

Specified by:
deactivate in class Jbi4CorbaEndpoint
Throws:
Exception - The exception

getProcessor

public ExchangeProcessor getProcessor()
Override.

Returns:
The processor
See Also:
ConsumerExchangeProcessor.

registerService

public void registerService()
                     throws Jbi4CorbaDeployException
this method has the following flow. First the wsdl is recovered. The wsdl at the moment is got from an existing jbi internal endpoint. In the future it could be given as a URL. second the service creator with the wsdl is called third the service invocation handler is created fourth the endpoint metadata is published. (How to publish an external endpoint non SOAP???)

Specified by:
registerService in class Jbi4CorbaEndpoint
Throws:
javax.jbi.management.DeploymentException - The deployment exception
Jbi4CorbaDeployException

findFirstPortType

protected static javax.wsdl.PortType findFirstPortType(javax.wsdl.Definition def)
This method find the first PortType in the definition.

Parameters:
def - The WSDL definition.
Returns:
The PortType found.

addOperationToWsdlBinding

protected static void addOperationToWsdlBinding(javax.wsdl.Definition wsdl,
                                                javax.wsdl.PortType portType,
                                                javax.wsdl.Binding wsdlBinding)
If there isn't the concrete part of the wsdl we must construct it using the abstract part and this method adds the 'operations' in the PortType to the binding.

Parameters:
wsdl - The WSDL definition.
portType - A PortType.
wsdlBinding - A Binding.

addSOAPExtensionsToWSDL

protected static javax.wsdl.Definition addSOAPExtensionsToWSDL(javax.wsdl.Definition def)
                                                        throws javax.wsdl.WSDLException
Adds SOAP extensions to wsdl. This code expects that the PortTypeName is the real interface name.

Parameters:
def - The WSDL definition.
Returns:
The new WSDL definition.
Throws:
javax.wsdl.WSDLException

getConsumerServiceDescriptor

public ConsumerServiceDescriptor getConsumerServiceDescriptor()
Getter.

Returns:
The consumer service descriptor.

setConsumerServiceDescriptor

public void setConsumerServiceDescriptor(ConsumerServiceDescriptor consumerServiceDescriptor)
Setter.

Parameters:
consumerServiceDescriptor - The consumer service descriptor

retrieveProxiedEndpointDefinition

protected javax.jbi.servicedesc.ServiceEndpoint retrieveProxiedEndpointDefinition()
                                                                           throws Jbi4CorbaDeployException
Create a wsdl definition for a consumer endpoint. Loads the target endpoint definition and add http binding informations to it.

Returns:
The return
Throws:
javax.jbi.management.DeploymentException - The deployment exception
Jbi4CorbaDeployException

validate

public void validate()
              throws Jbi4CorbaException
Validate the endpoint. (now do noting)

Specified by:
validate in class Jbi4CorbaEndpoint
Throws:
Jbi4EjbException - if some problem occurs
Jbi4CorbaException - if something go wrong

unregisterService

public void unregisterService()
                       throws Jbi4CorbaException
Unregisters the service.

Specified by:
unregisterService in class Jbi4CorbaEndpoint
Throws:
Jbi4EjbException - if some problem occurs
Jbi4CorbaException - if something go wrong
See Also:
it.imolinfo.jbi4ejb.jbi.endpoint.Jbi4EjbEndpoint#unregisterService()

getRole

public javax.jbi.messaging.MessageExchange.Role getRole()
Gets the provider role.

Specified by:
getRole in class Jbi4CorbaEndpoint
Returns:


Copyright © 2005-2010 Imola Informatica. All Rights Reserved.