org.ow2.petals.component.framework
Class AbstractComponent

java.lang.Object
  extended by org.ow2.petals.component.framework.AbstractComponent
All Implemented Interfaces:
javax.jbi.component.Component, javax.jbi.component.ComponentLifeCycle, org.ow2.petals.component.framework.api.PetalsComponent
Direct Known Subclasses:
AbstractBindingComponent, AbstractServiceEngine

public abstract class AbstractComponent
extends java.lang.Object
implements org.ow2.petals.component.framework.api.PetalsComponent

An abstract class that can be used to easily create a new JBI Component.
It implements the Component interface.
It allow to manage directly endpoints.
To do this, simply put into the resources of the project a valid wsdl named 'component.wsdl'

Since:
1.0
Author:
ofabre - EBMWebsourcing, fgardes - EBMWebsourcing

Field Summary
protected  javax.jbi.component.ComponentContext context
          The Component's Context
 
Constructor Summary
AbstractComponent()
           
 
Method Summary
 javax.jbi.servicedesc.ServiceEndpoint activateEndpoint(javax.xml.namespace.QName serviceName, java.lang.String endpointName)
          Store wsdl and then activate endpoint in the JBI context
protected abstract  AbstractServiceUnitManager createServiceUnitManager()
          Can be overridden to provide a specific service unit manager
 void deactivateEndpoint(javax.jbi.servicedesc.ServiceEndpoint serviceEndpoint)
           
protected  void doInit()
          A convenience method which can be overridden so that there's no need to call super.doInit().
protected  void doShutdown()
          A convenience method which can be overridden so that there's no need to call super.doShutdown().
protected  void doStart()
          A convenience method which can be overridden so that there's no need to call super.doStart().
protected  void doStop()
          A convenience method which can be overridden so that there's no need to call super.doStop().
 AsyncMessageManager getAsyncManager()
           
 javax.jbi.messaging.DeliveryChannel getChannel()
           
 org.ow2.petals.component.framework.jbidescriptor.generated.Component getComponentConfiguration()
           
 org.ow2.petals.component.framework.api.configuration.ConfigurationExtensions getComponentExtensions()
           
 javax.jbi.component.ComponentContext getContext()
           
 javax.management.ObjectName getExtensionMBeanName()
           
 org.ow2.petals.component.framework.api.Interceptor getInterceptor(java.lang.String name)
           
 java.util.Map<java.lang.String,org.ow2.petals.component.framework.api.Interceptor> getInterceptors()
           
 javax.jbi.component.ComponentLifeCycle getLifeCycle()
           
 java.util.logging.Logger getLogger()
           
 org.ow2.petals.component.framework.api.Wsdl getNativeWsdl()
          Get the nativeWsdl
 JBIProcessorManager getProcessorManager()
          Return the JBI processor manager
protected  java.lang.String getResourceBundleName()
          Can be overridden to return a custom resource bundle name
 org.w3c.dom.Document getServiceDescription(javax.jbi.servicedesc.ServiceEndpoint endpoint)
           
 javax.jbi.component.ServiceUnitManager getServiceUnitManager()
           
 void init(javax.jbi.component.ComponentContext compContext)
           
 boolean isExchangeWithConsumerOkay(javax.jbi.servicedesc.ServiceEndpoint endpoint, javax.jbi.messaging.MessageExchange exchange)
           
 boolean isExchangeWithProviderOkay(javax.jbi.servicedesc.ServiceEndpoint endpoint, javax.jbi.messaging.MessageExchange exchange)
           
 javax.jbi.servicedesc.ServiceEndpoint resolveEndpointReference(org.w3c.dom.DocumentFragment epr)
           
 void shutDown()
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected javax.jbi.component.ComponentContext context
The Component's Context

Constructor Detail

AbstractComponent

public AbstractComponent()
Method Detail

getAsyncManager

public AsyncMessageManager getAsyncManager()

getChannel

public javax.jbi.messaging.DeliveryChannel getChannel()
Specified by:
getChannel in interface org.ow2.petals.component.framework.api.PetalsComponent

getComponentConfiguration

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

getComponentExtensions

public org.ow2.petals.component.framework.api.configuration.ConfigurationExtensions getComponentExtensions()

getContext

public javax.jbi.component.ComponentContext getContext()
Specified by:
getContext in interface org.ow2.petals.component.framework.api.PetalsComponent

getExtensionMBeanName

public javax.management.ObjectName getExtensionMBeanName()
Specified by:
getExtensionMBeanName in interface javax.jbi.component.ComponentLifeCycle

getInterceptor

public org.ow2.petals.component.framework.api.Interceptor getInterceptor(java.lang.String name)
Specified by:
getInterceptor in interface org.ow2.petals.component.framework.api.PetalsComponent

getInterceptors

public java.util.Map<java.lang.String,org.ow2.petals.component.framework.api.Interceptor> getInterceptors()
Specified by:
getInterceptors in interface org.ow2.petals.component.framework.api.PetalsComponent

getLifeCycle

public javax.jbi.component.ComponentLifeCycle getLifeCycle()
Specified by:
getLifeCycle in interface javax.jbi.component.Component

getLogger

public java.util.logging.Logger getLogger()
Specified by:
getLogger in interface org.ow2.petals.component.framework.api.PetalsComponent

getNativeWsdl

public org.ow2.petals.component.framework.api.Wsdl getNativeWsdl()
Get the nativeWsdl

Returns:
the nativeWsdl

getServiceDescription

public org.w3c.dom.Document getServiceDescription(javax.jbi.servicedesc.ServiceEndpoint endpoint)
Specified by:
getServiceDescription in interface javax.jbi.component.Component

getServiceUnitManager

public javax.jbi.component.ServiceUnitManager getServiceUnitManager()
Specified by:
getServiceUnitManager in interface javax.jbi.component.Component

init

public final void init(javax.jbi.component.ComponentContext compContext)
                throws javax.jbi.JBIException
Specified by:
init in interface javax.jbi.component.ComponentLifeCycle
Throws:
javax.jbi.JBIException

isExchangeWithConsumerOkay

public boolean isExchangeWithConsumerOkay(javax.jbi.servicedesc.ServiceEndpoint endpoint,
                                          javax.jbi.messaging.MessageExchange exchange)
Specified by:
isExchangeWithConsumerOkay in interface javax.jbi.component.Component

isExchangeWithProviderOkay

public boolean isExchangeWithProviderOkay(javax.jbi.servicedesc.ServiceEndpoint endpoint,
                                          javax.jbi.messaging.MessageExchange exchange)
Specified by:
isExchangeWithProviderOkay in interface javax.jbi.component.Component

resolveEndpointReference

public javax.jbi.servicedesc.ServiceEndpoint resolveEndpointReference(org.w3c.dom.DocumentFragment epr)
Specified by:
resolveEndpointReference in interface javax.jbi.component.Component

shutDown

public final void shutDown()
                    throws javax.jbi.JBIException
Specified by:
shutDown in interface javax.jbi.component.ComponentLifeCycle
Throws:
javax.jbi.JBIException

start

public final void start()
                 throws javax.jbi.JBIException
Specified by:
start in interface javax.jbi.component.ComponentLifeCycle
Throws:
javax.jbi.JBIException

stop

public final void stop()
                throws javax.jbi.JBIException
Specified by:
stop in interface javax.jbi.component.ComponentLifeCycle
Throws:
javax.jbi.JBIException

createServiceUnitManager

protected abstract AbstractServiceUnitManager createServiceUnitManager()
Can be overridden to provide a specific service unit manager

Returns:
the service unit manager used by this component.

doInit

protected void doInit()
               throws javax.jbi.JBIException
A convenience method which can be overridden so that there's no need to call super.doInit(). This method is called at the end of the component classical initialization. When this method is called, the component's delivery channel, context, logger and service unit manager are available.

Throws:
javax.jbi.JBIException

doShutdown

protected void doShutdown()
                   throws javax.jbi.JBIException
A convenience method which can be overridden so that there's no need to call super.doShutdown(). This method is called at the end of the component classical shutdown.

Throws:
javax.jbi.JBIException

doStart

protected void doStart()
                throws javax.jbi.JBIException
A convenience method which can be overridden so that there's no need to call super.doStart(). This method is called at the end of the component classical start.

Throws:
javax.jbi.JBIException

doStop

protected void doStop()
               throws javax.jbi.JBIException
A convenience method which can be overridden so that there's no need to call super.doStop(). This method is called at the end of the component classical stop.

Throws:
javax.jbi.JBIException

getResourceBundleName

protected java.lang.String getResourceBundleName()
Can be overridden to return a custom resource bundle name

Returns:
the resource bundle name or null if no resource bundle name has to be used (default value)

activateEndpoint

public javax.jbi.servicedesc.ServiceEndpoint activateEndpoint(javax.xml.namespace.QName serviceName,
                                                              java.lang.String endpointName)
                                                       throws javax.jbi.JBIException
Store wsdl and then activate endpoint in the JBI context

Parameters:
serviceName -
endpointName -
Throws:
javax.jbi.JBIException

deactivateEndpoint

public void deactivateEndpoint(javax.jbi.servicedesc.ServiceEndpoint serviceEndpoint)
                        throws javax.jbi.JBIException
Throws:
javax.jbi.JBIException

getProcessorManager

public JBIProcessorManager getProcessorManager()
Return the JBI processor manager

Returns:
the JBI processor manager


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