javax.jbi.component.Component Maven / Gradle / Ivy
Show all versions of petals-jbi Show documentation
/**
* @(#) Component.java
*
* PETALS - PETALS Services Platform.
* Copyright (c) 2005 Fossil E-Commerce, http://www.fossilec.com/
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* -------------------------------------------------------------------------
* $Id: Component.java 221 2006-04-14 12:45:33Z alouis $
* -------------------------------------------------------------------------
*/
//
// This source code implements specifications defined by the Java
// Community Process. In order to remain compliant with the specification
// DO NOT add / change / or delete method signatures!
//
package javax.jbi.component;
/**
* This interface, implemented by component implementations, allows the JBI
* implementation to query the component for various types of information. This
* includes:
*
* - The component's life cycle control interface.
* - The component's service unit manager, for handling deployments.
* - A method for querying service metadata describing services provided by
* this component.
*
- "Policy" methods that are called by the JBI implementation to query if
* proposed matches of this component to a provider (or consumer) are
* acceptable, according to this component's policies.
* - Endpoint reference (EPR) resolution. Some components will provide the
* ability to resolve EPRs (typically binding components). This ability to
* resolve EPRs is used by JBI to facilitate resolution of EPRs received by
* service consumers.
*
*
* The name of the class that implements this interface for a component is
* specified in the installation descriptor for that component.
*
* @author JSR208 Expert Group
*/
public interface Component {
/**
* Get the life cycle control interface for this component. This interface
* allows the JBI implementation to control the running state of this
* component.
*
* This method must be called before any other methods of this interface are
* called. In addition, the JBI implementation must call the init() method
* of the component life cycle returned by this method before calling any
* other methods on this interface, or the component life cycle interface.
*
* @return The life cycle control interface for this component; must be
* non-null.
*/
public javax.jbi.component.ComponentLifeCycle getLifeCycle();
/**
* Retrieves a DOM representation containing metadata which describes the
* service provided by this component, through the given endpoint. The
* result can use WSDL 1.1 or WSDL 2.0.
*
* @param endpoint
* the service endpoint.
* @return the description for specified service endpoint.
*/
public org.w3c.dom.Document getServiceDescription(
javax.jbi.servicedesc.ServiceEndpoint endpoint);
/**
* Get the ServiceUnitManager for this component. If this component does not
* support deployments, it must return null
.
*
* @return the ServiceUnitManager
for this component,
* null
if none there is none.
*/
public javax.jbi.component.ServiceUnitManager getServiceUnitManager();
/**
* This method is called by JBI to check if this component, in the role of
* provider of the service indicated by the given exchange, can actually
* perform the operation desired.
*
* @param endpoint
* the endpoint to be used by the consumer; must be non-null.
* @param exchange
* the proposed message exchange to be performed; must be
* non-null.
* @return true
if this provider component can perform the
* given exchange with the described consumer.
*/
public boolean isExchangeWithConsumerOkay(
javax.jbi.servicedesc.ServiceEndpoint endpoint,
javax.jbi.messaging.MessageExchange exchange);
/**
* This method is called by JBI to check if this component, in the role of
* consumer of the service indicated by the given exchange, can actually
* interact with the provider properly. The provider is described by the
* given endpoint and the service description supplied by the given
* endpoint.
*
* @param endpoint
* the endpoint to be used by the provider; must be non-null.
* @param exchange
* the proposed message exchange to be performed; must be
* non-null.
* @return true
if this consumer component can interact with
* the described provider to perform the given exchange.
*/
public boolean isExchangeWithProviderOkay(
javax.jbi.servicedesc.ServiceEndpoint endpoint,
javax.jbi.messaging.MessageExchange exchange);
/**
* Resolve the given endpoint reference. This is called by JBI when it is
* attempting to resolve the given EPR on behalf of a component.
*
* If this component returns a non-null result, it must conform to the
* following:
*
* - This component implements the
* {@link javax.jbi.servicedesc.ServiceEndpoint} returned.
*
- The result must not be registered or activated with the JBI
* implementation.
*
*
* Dynamically resolved endpoints are distinct from static ones; they must
* not be activated (see
* {@link ComponentContext#activateEndpoint(QName, String)}), nor
* registered (see {@link ComponentContext}) by components. They can only
* be used to address message exchanges; the JBI implementation must deliver
* such exchanges to the component that resolved the endpoint reference (see
* {@link ComponentContext#resolveEndpointReference(DocumentFragment)}).
*
* @param epr
* the endpoint reference, in some XML dialect understood by the
* appropriate component (usually a binding); must be non-null.
* @return the service endpoint for the EPR; null
if the EPR
* cannot be resolved by this component.
*/
public javax.jbi.servicedesc.ServiceEndpoint resolveEndpointReference(
org.w3c.dom.DocumentFragment epr);
}