org.ow2.petals.component.framework.su
Class AbstractServiceUnitManager

java.lang.Object
  extended by org.ow2.petals.component.framework.su.AbstractServiceUnitManager
All Implemented Interfaces:
javax.jbi.component.ServiceUnitManager
Direct Known Subclasses:
BindingComponentServiceUnitManager, ServiceEngineServiceUnitManager

public abstract class AbstractServiceUnitManager
extends java.lang.Object
implements javax.jbi.component.ServiceUnitManager

The common part of the ServiceUnitManager. It handles service units JBI descriptor during their deployment, life-cycle and undeployment.

Author:
ofabre - EBM Websourcing, alouis - EBM Websourcing

Field Summary
protected  AbstractComponent component
          The reference to the component
protected  java.util.logging.Logger logger
          The component's Logger
 
Constructor Summary
AbstractServiceUnitManager(AbstractComponent component)
          Creates a new instance of AbstractServiceUnitManager
 
Method Summary
 java.lang.String deploy(java.lang.String serviceUnitName, java.lang.String suRootPath)
           
protected  void doDeploy(java.lang.String serviceUnitName, java.lang.String suRootPath, org.ow2.petals.component.framework.jbidescriptor.generated.Jbi jbiDescriptor)
          Override this method to implement your component logic on the deploy step.
protected  void doInit(java.lang.String serviceUnitName, java.lang.String suRootPath)
          Override this method to implement your component logic on the init step.
protected  void doShutdown(java.lang.String serviceUnitName)
          Override this method to implement your component logic on the shut down step.
protected  void doStart(java.lang.String serviceUnitName)
          Override this method to implement your component logic on the start step.
protected  void doStop(java.lang.String serviceUnitName)
          Override this method to implement your component logic on the stop step.
protected  void doUndeploy(java.lang.String serviceUnitName)
          Override this method to implement your component logic on the undeploy step.
 org.ow2.petals.component.framework.jbidescriptor.generated.Consumes getConsumesForEndpoint(java.lang.String endpointName)
          Get the consumes matching the given endpoint name.
 org.ow2.petals.component.framework.jbidescriptor.generated.Consumes getConsumesForInterface(javax.xml.namespace.QName interfaceName)
          Get the consumes matching the given service name.
 org.ow2.petals.component.framework.jbidescriptor.generated.Consumes getConsumesForService(javax.xml.namespace.QName serviceName)
          Get the consumes matching the given service name.
 org.ow2.petals.component.framework.jbidescriptor.generated.Consumes getConsumesFromDestination(java.lang.String endpointName, javax.xml.namespace.QName serviceName, javax.xml.namespace.QName interfaceName)
          Retrieve the Consumes node matching the given destination information (endpoint name, service name, interface name).
 java.util.Set<javax.jbi.servicedesc.ServiceEndpoint> getEndpointsForServiceUnit(java.lang.String serviceUnitName)
          Get the set of endpoints exposed by the given Service Unit.
 org.ow2.petals.component.framework.jbidescriptor.generated.Provides getProvidesFromEndpoint(javax.jbi.servicedesc.ServiceEndpoint serviceEndpoint)
          Retrieve the Provides node that has activated the given jbi Endpoint
 org.w3c.dom.Document getServiceDescription(javax.jbi.servicedesc.ServiceEndpoint serviceEndpoint)
          Retrieve the Service description (as DOM Document) of the given jbi Endpoint
 java.util.Map<java.lang.String,ServiceUnitDataHandler> getServiceUnitDataHandlers()
          Return all ServiceUnitDataHandlers as a Map
 ServiceUnitDataHandler getSUDataHandlerForConsumes(org.ow2.petals.component.framework.jbidescriptor.generated.Consumes consumes)
          Get the SU Data Handler matching the given Provides.
 ServiceUnitDataHandler getSUDataHandlerForEndpoint(javax.jbi.servicedesc.ServiceEndpoint endpoint)
          Retrieve the data handler of the Service Unit that has activated the given endpoint.
 ServiceUnitDataHandler getSUDataHandlerForProvides(org.ow2.petals.component.framework.jbidescriptor.generated.Provides provides)
          Get the SU Data Handler matching the given Consumes.
 ServiceUnitDataHandler getSUDataHandlerForService(java.lang.Object service)
          Get the SU Data Handler matching the given Consumes/Provides service.
 void init(java.lang.String serviceUnitName, java.lang.String suRootPath)
           
 void shutDown(java.lang.String serviceUnitName)
           
 void start(java.lang.String serviceUnitName)
           
 void stop(java.lang.String serviceUnitName)
           
 java.lang.String undeploy(java.lang.String serviceUnitName, java.lang.String suRootPath)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

component

protected final AbstractComponent component
The reference to the component


logger

protected java.util.logging.Logger logger
The component's Logger

Constructor Detail

AbstractServiceUnitManager

public AbstractServiceUnitManager(AbstractComponent component)
Creates a new instance of AbstractServiceUnitManager

Parameters:
component -
Method Detail

deploy

public java.lang.String deploy(java.lang.String serviceUnitName,
                               java.lang.String suRootPath)
                        throws javax.jbi.management.DeploymentException
Specified by:
deploy in interface javax.jbi.component.ServiceUnitManager
Throws:
javax.jbi.management.DeploymentException

getConsumesForEndpoint

public org.ow2.petals.component.framework.jbidescriptor.generated.Consumes getConsumesForEndpoint(java.lang.String endpointName)
Get the consumes matching the given endpoint name.

Parameters:
serviceName - The endpoint name to match
Returns:
The Consumes instance if matched, @ null} otherwise

getConsumesForInterface

public org.ow2.petals.component.framework.jbidescriptor.generated.Consumes getConsumesForInterface(javax.xml.namespace.QName interfaceName)
Get the consumes matching the given service name.

Parameters:
serviceName - The service qualified name to match
Returns:
The Consumes instance if matched, @ null} otherwise

getConsumesForService

public org.ow2.petals.component.framework.jbidescriptor.generated.Consumes getConsumesForService(javax.xml.namespace.QName serviceName)
Get the consumes matching the given service name.

Parameters:
serviceName - The service qualified name to match
Returns:
The Consumes instance if matched, @ null} otherwise

getConsumesFromDestination

public org.ow2.petals.component.framework.jbidescriptor.generated.Consumes getConsumesFromDestination(java.lang.String endpointName,
                                                                                                      javax.xml.namespace.QName serviceName,
                                                                                                      javax.xml.namespace.QName interfaceName)
Retrieve the Consumes node matching the given destination information (endpoint name, service name, interface name). Search order is by ascending priority : endpointName, serviceName, interfaceName. If there are many consumes matching information, return the first one found.

Parameters:
endpointName - an endpoint name, can be null
serviceName - a service QName, can be null
interfaceName - an interface QName, can be null
Returns:
the Consumes element matching information, can be null

getEndpointsForServiceUnit

public java.util.Set<javax.jbi.servicedesc.ServiceEndpoint> getEndpointsForServiceUnit(java.lang.String serviceUnitName)
Get the set of endpoints exposed by the given Service Unit.

Parameters:
serviceUnitName - The name of the Service Unit
Returns:
a set of ServiceEndpoint

getProvidesFromEndpoint

public org.ow2.petals.component.framework.jbidescriptor.generated.Provides getProvidesFromEndpoint(javax.jbi.servicedesc.ServiceEndpoint serviceEndpoint)
Retrieve the Provides node that has activated the given jbi Endpoint

Parameters:
serviceEndpoint - the previously activated jbi Endpoint
Returns:
the Provides element

getServiceDescription

public org.w3c.dom.Document getServiceDescription(javax.jbi.servicedesc.ServiceEndpoint serviceEndpoint)
Retrieve the Service description (as DOM Document) of the given jbi Endpoint

Parameters:
serviceEndpoint - the jbi Endpoint
Returns:
the service description as Dom Document

getServiceUnitDataHandlers

public java.util.Map<java.lang.String,ServiceUnitDataHandler> getServiceUnitDataHandlers()
Return all ServiceUnitDataHandlers as a Map

Returns:
all ServiceUnitDataHandlers as a Map

getSUDataHandlerForConsumes

public ServiceUnitDataHandler getSUDataHandlerForConsumes(org.ow2.petals.component.framework.jbidescriptor.generated.Consumes consumes)
Get the SU Data Handler matching the given Provides.

Parameters:
consumes - The @ code Consumes} instance
Returns:

getSUDataHandlerForEndpoint

public ServiceUnitDataHandler getSUDataHandlerForEndpoint(javax.jbi.servicedesc.ServiceEndpoint endpoint)
Retrieve the data handler of the Service Unit that has activated the given endpoint.

Parameters:
endpoint - the
Returns:
the ServiceUnitDataHandler

getSUDataHandlerForProvides

public ServiceUnitDataHandler getSUDataHandlerForProvides(org.ow2.petals.component.framework.jbidescriptor.generated.Provides provides)
Get the SU Data Handler matching the given Consumes.

Parameters:
provides - The @ code Provides} instance
Returns:

getSUDataHandlerForService

public ServiceUnitDataHandler getSUDataHandlerForService(java.lang.Object service)
Get the SU Data Handler matching the given Consumes/Provides service.

Parameters:
consumes - The @ code Consumes} instance
Returns:

init

public void init(java.lang.String serviceUnitName,
                 java.lang.String suRootPath)
          throws javax.jbi.management.DeploymentException
Specified by:
init in interface javax.jbi.component.ServiceUnitManager
Throws:
javax.jbi.management.DeploymentException

shutDown

public void shutDown(java.lang.String serviceUnitName)
              throws javax.jbi.management.DeploymentException
Specified by:
shutDown in interface javax.jbi.component.ServiceUnitManager
Throws:
javax.jbi.management.DeploymentException

start

public void start(java.lang.String serviceUnitName)
           throws javax.jbi.management.DeploymentException
Specified by:
start in interface javax.jbi.component.ServiceUnitManager
Throws:
javax.jbi.management.DeploymentException

stop

public void stop(java.lang.String serviceUnitName)
          throws javax.jbi.management.DeploymentException
Specified by:
stop in interface javax.jbi.component.ServiceUnitManager
Throws:
javax.jbi.management.DeploymentException

undeploy

public java.lang.String undeploy(java.lang.String serviceUnitName,
                                 java.lang.String suRootPath)
                          throws javax.jbi.management.DeploymentException
Specified by:
undeploy in interface javax.jbi.component.ServiceUnitManager
Throws:
javax.jbi.management.DeploymentException

doDeploy

protected void doDeploy(java.lang.String serviceUnitName,
                        java.lang.String suRootPath,
                        org.ow2.petals.component.framework.jbidescriptor.generated.Jbi jbiDescriptor)
                 throws org.ow2.petals.component.framework.api.exception.PEtALSCDKException
Override this method to implement your component logic on the deploy step.

Throws:
org.ow2.petals.component.framework.api.exception.PEtALSCDKException

doInit

protected void doInit(java.lang.String serviceUnitName,
                      java.lang.String suRootPath)
               throws org.ow2.petals.component.framework.api.exception.PEtALSCDKException
Override this method to implement your component logic on the init step.

Throws:
org.ow2.petals.component.framework.api.exception.PEtALSCDKException

doShutdown

protected void doShutdown(java.lang.String serviceUnitName)
                   throws org.ow2.petals.component.framework.api.exception.PEtALSCDKException
Override this method to implement your component logic on the shut down step.

Throws:
org.ow2.petals.component.framework.api.exception.PEtALSCDKException

doStart

protected void doStart(java.lang.String serviceUnitName)
                throws org.ow2.petals.component.framework.api.exception.PEtALSCDKException
Override this method to implement your component logic on the start step.

Throws:
org.ow2.petals.component.framework.api.exception.PEtALSCDKException

doStop

protected void doStop(java.lang.String serviceUnitName)
               throws org.ow2.petals.component.framework.api.exception.PEtALSCDKException
Override this method to implement your component logic on the stop step.

Throws:
org.ow2.petals.component.framework.api.exception.PEtALSCDKException

doUndeploy

protected void doUndeploy(java.lang.String serviceUnitName)
                   throws org.ow2.petals.component.framework.api.exception.PEtALSCDKException
Override this method to implement your component logic on the undeploy step.

Throws:
org.ow2.petals.component.framework.api.exception.PEtALSCDKException


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