001: // Copyright (c) 2004-2005 Sun Microsystems Inc., All Rights Reserved.
002:
003: /*
004: * SequencingEngineComponent.java
005: *
006: * SUN PROPRIETARY/CONFIDENTIAL.
007: * This software is the proprietary information of Sun Microsystems, Inc.
008: * Use is subject to license terms.
009: *
010: */
011: package com.sun.jbi.engine.sequencing;
012:
013: import org.w3c.dom.DocumentFragment;
014:
015: import javax.jbi.component.Component;
016: import javax.jbi.servicedesc.ServiceEndpoint;
017:
018: /**
019: * This class implements the component contract with the JBI.
020: *
021: * @author Sun Microsystems, Inc.
022: */
023: public class SequencingEngineComponent implements Component {
024: /**
025: * Lifecycle object.
026: */
027: private SequencingEngineLifeCycle mLifeCycle;
028:
029: /**
030: * SU Manager.
031: */
032: private SequencingEngineSUManager mSUManager;
033:
034: /**
035: * Creates a new instance of SequencingEngineComponent
036: */
037: public SequencingEngineComponent() {
038: mLifeCycle = new SequencingEngineLifeCycle();
039: mSUManager = new SequencingEngineSUManager();
040: mLifeCycle.setSUManager(mSUManager);
041: }
042:
043: /**
044: * This method is called by JBI to check if this component, in the role of
045: * provider of the service indicated by the given exchange, can actually
046: * perform the operation desired.
047: *
048: * @param endpoint
049: * @param exchange
050: *
051: * @return true if Ok.
052: */
053: public boolean isExchangeWithConsumerOkay(
054: javax.jbi.servicedesc.ServiceEndpoint endpoint,
055: javax.jbi.messaging.MessageExchange exchange) {
056: return true;
057: }
058:
059: /**
060: * This method is called by JBI to check if this component, in the role of
061: * consumer of the service indicated by the given exchange, can actually
062: * interact with the the provider completely.
063: *
064: * @param endpoint
065: * @param exchange
066: *
067: * @return true if OK.
068: */
069: public boolean isExchangeWithProviderOkay(
070: javax.jbi.servicedesc.ServiceEndpoint endpoint,
071: javax.jbi.messaging.MessageExchange exchange) {
072: return true;
073: }
074:
075: /**
076: * Returns the lifecycle object.
077: *
078: * @return ComponentLifecycle.
079: */
080: public javax.jbi.component.ComponentLifeCycle getLifeCycle() {
081: return mLifeCycle;
082: }
083:
084: /**
085: * Returns the service description.
086: *
087: * @param endpoint service endpoint.
088: *
089: * @return document.
090: */
091: public org.w3c.dom.Document getServiceDescription(
092: javax.jbi.servicedesc.ServiceEndpoint endpoint) {
093: return null;
094: }
095:
096: /**
097: * Returns a SU Mangaer object.
098: *
099: * @return Su Manager for SE.
100: */
101: public javax.jbi.component.ServiceUnitManager getServiceUnitManager() {
102: return mSUManager;
103: }
104:
105: /**
106: * Resolve the endpoint reference using the given capabilities of the
107: * consumer. This is called by JBI when its trying to resove the given EPR
108: * on behalf of the component.
109: *
110: * @param epr endpoint reference.
111: *
112: * @return service endpoint.
113: */
114: public ServiceEndpoint resolveEndpointReference(DocumentFragment epr) {
115: return null;
116: }
117: }
|