org.apache.servicemix.common.endpoints
Class AbstractEndpoint

java.lang.Object
  extended by org.apache.servicemix.common.endpoints.AbstractEndpoint
All Implemented Interfaces:
Endpoint
Direct Known Subclasses:
SimpleEndpoint

public abstract class AbstractEndpoint
extends java.lang.Object
implements Endpoint


Field Summary
protected  javax.wsdl.Definition definition
           
protected  org.w3c.dom.Document description
           
protected  java.lang.String endpoint
           
protected  javax.xml.namespace.QName interfaceName
           
protected  org.slf4j.Logger logger
           
protected  javax.xml.namespace.QName service
           
protected  ServiceUnit serviceUnit
           
 
Constructor Summary
AbstractEndpoint()
           
AbstractEndpoint(ServiceUnit serviceUnit, javax.xml.namespace.QName service, java.lang.String endpoint)
           
 
Method Summary
abstract  void activate()
          Register this endpoint into the NMR and put the endpoint in a STOPPED state, where the endpoint is able to process incoming requests, but won't consume external requests such as JMS messages or HTTP requests.
abstract  void deactivate()
          Unregister this endpoint from the NMR.
 javax.wsdl.Definition getDefinition()
           
 org.w3c.dom.Document getDescription()
           Get the endpoint description.
 java.lang.String getEndpoint()
           Get the endpoint implementation.
 javax.xml.namespace.QName getInterfaceName()
           Get the qualified name of the endpoint interface.
 java.lang.String getKey()
           
abstract  javax.jbi.messaging.MessageExchange.Role getRole()
           Get the endpoint role.
 javax.xml.namespace.QName getService()
           Get the service qualified name of the endpoint.
 ServiceUnit getServiceUnit()
           Get the service unit associated to the endpoint.
 boolean isExchangeOkay(javax.jbi.messaging.MessageExchange exchange)
           
 void prepareExchange(javax.jbi.messaging.MessageExchange exchange)
           
abstract  void process(javax.jbi.messaging.MessageExchange exchange)
          Process an incoming JBI exchange.
 void setDefinition(javax.wsdl.Definition definition)
           
 void setDescription(org.w3c.dom.Document description)
           Associates an XML document with the endpoint.
 void setEndpoint(java.lang.String endpoint)
           The name of the endpoint.
 void setInterfaceName(javax.xml.namespace.QName interfaceName)
           The qualified name of the interface exposed by the endpoint.
 void setService(javax.xml.namespace.QName service)
           The qualified name of the service the endpoint exposes.
 void setServiceUnit(ServiceUnit serviceUnit)
           Associates an endpoint with a service unit.
abstract  void start()
          Start consumption of external requests.
abstract  void stop()
          Stop consumption of external requests.
 java.lang.String toString()
           
 void validate()
          Validate the endpoint at either deployment time for statically defined endpoints or at runtime for dynamic endpoints
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

service

protected javax.xml.namespace.QName service

endpoint

protected java.lang.String endpoint

interfaceName

protected javax.xml.namespace.QName interfaceName

description

protected org.w3c.dom.Document description

definition

protected javax.wsdl.Definition definition

serviceUnit

protected ServiceUnit serviceUnit

logger

protected org.slf4j.Logger logger
Constructor Detail

AbstractEndpoint

public AbstractEndpoint()

AbstractEndpoint

public AbstractEndpoint(ServiceUnit serviceUnit,
                        javax.xml.namespace.QName service,
                        java.lang.String endpoint)
Method Detail

getEndpoint

public java.lang.String getEndpoint()

Get the endpoint implementation.

Specified by:
getEndpoint in interface Endpoint
Returns:
Returns the endpoint.

setEndpoint

public void setEndpoint(java.lang.String endpoint)

The name of the endpoint.

Parameters:
endpoint - a string specifiying the name of the endpoint

getService

public javax.xml.namespace.QName getService()

Get the service qualified name of the endpoint.

Specified by:
getService in interface Endpoint
Returns:
Returns the service.

setService

public void setService(javax.xml.namespace.QName service)

The qualified name of the service the endpoint exposes.

Parameters:
service - a QName specifiying the name of the service

getRole

public abstract javax.jbi.messaging.MessageExchange.Role getRole()

Get the endpoint role.

Specified by:
getRole in interface Endpoint
Returns:
Returns the role.

getDescription

public org.w3c.dom.Document getDescription()

Get the endpoint description.

Specified by:
getDescription in interface Endpoint
Returns:
Returns the description.

setDescription

public void setDescription(org.w3c.dom.Document description)

Associates an XML document with the endpoint. The XML document describes the endpoint and is typically found in the service unit packaging.

Parameters:
description - a Document describing the endpoint

getInterfaceName

public javax.xml.namespace.QName getInterfaceName()

Get the qualified name of the endpoint interface.

Specified by:
getInterfaceName in interface Endpoint
Returns:
Returns the interfaceName.

setInterfaceName

public void setInterfaceName(javax.xml.namespace.QName interfaceName)

The qualified name of the interface exposed by the endpoint.

Parameters:
interfaceName - a QName specifiying the name of the interface

getServiceUnit

public ServiceUnit getServiceUnit()

Get the service unit associated to the endpoint.

Specified by:
getServiceUnit in interface Endpoint
Returns:
Returns the serviceUnit.

setServiceUnit

public void setServiceUnit(ServiceUnit serviceUnit)

Associates an endpoint with a service unit. The service unit is used by the container to manage the endpoint's lifecycle.

Specified by:
setServiceUnit in interface Endpoint
Parameters:
serviceUnit - a ServiceUnit to which the endpoint will be associated

isExchangeOkay

public boolean isExchangeOkay(javax.jbi.messaging.MessageExchange exchange)
Specified by:
isExchangeOkay in interface Endpoint

prepareExchange

public void prepareExchange(javax.jbi.messaging.MessageExchange exchange)
                     throws javax.jbi.messaging.MessagingException
Throws:
javax.jbi.messaging.MessagingException

activate

public abstract void activate()
                       throws java.lang.Exception
Description copied from interface: Endpoint
Register this endpoint into the NMR and put the endpoint in a STOPPED state, where the endpoint is able to process incoming requests, but won't consume external requests such as JMS messages or HTTP requests.

Specified by:
activate in interface Endpoint
Throws:
java.lang.Exception

start

public abstract void start()
                    throws java.lang.Exception
Description copied from interface: Endpoint
Start consumption of external requests.

Specified by:
start in interface Endpoint
Throws:
java.lang.Exception

stop

public abstract void stop()
                   throws java.lang.Exception
Description copied from interface: Endpoint
Stop consumption of external requests.

Specified by:
stop in interface Endpoint
Throws:
java.lang.Exception

deactivate

public abstract void deactivate()
                         throws java.lang.Exception
Description copied from interface: Endpoint
Unregister this endpoint from the NMR.

Specified by:
deactivate in interface Endpoint
Throws:
java.lang.Exception

process

public abstract void process(javax.jbi.messaging.MessageExchange exchange)
                      throws java.lang.Exception
Description copied from interface: Endpoint
Process an incoming JBI exchange.

Specified by:
process in interface Endpoint
Throws:
java.lang.Exception

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

validate

public void validate()
              throws javax.jbi.management.DeploymentException
Validate the endpoint at either deployment time for statically defined endpoints or at runtime for dynamic endpoints

Specified by:
validate in interface Endpoint
Throws:
javax.jbi.management.DeploymentException

getDefinition

public javax.wsdl.Definition getDefinition()

setDefinition

public void setDefinition(javax.wsdl.Definition definition)
Parameters:
definition -

getKey

public java.lang.String getKey()
Specified by:
getKey in interface Endpoint


Copyright © 2005-2012 FuseSource. All Rights Reserved.