FileDocCategorySizeDatePackage
JavaEEServiceEngineContext.javaAPI DocGlassfish v2 API6029Fri May 04 22:30:28 BST 2007com.sun.enterprise.jbi.serviceengine.core

JavaEEServiceEngineContext

public class JavaEEServiceEngineContext extends Object
Wrapper for a JBI Context object, provides utility methods
author
Manisha Umbarje

Fields Summary
private javax.jbi.component.ComponentContext
jbiContext
private EndpointRegistry
endpointRegistry
private javax.jbi.messaging.DeliveryChannel
seDeliveryChannel
private com.sun.enterprise.jbi.serviceengine.work.WorkManagerImpl
workManager
private com.sun.enterprise.jbi.serviceengine.config.ComponentConfiguration
config
private Bridge
bridge
private static JavaEEServiceEngineContext
serviceEngineContext
protected static final Logger
logger
Internal handle to the logger instance
Constructors Summary
private JavaEEServiceEngineContext()
Creates a new instance of JavaEEServiceEngineContext


            
           
       
    
Methods Summary
public voidactivateEndpoints(java.util.Iterator endpoints)
Activates multiple end points in JBI

param
endpoints list of end points to be activated in JBI

        if (endpoints != null) {
            while(endpoints.hasNext()) {
                ServiceEndpoint endpoint = (ServiceEndpoint)endpoints.next();
                jbiContext.activateEndpoint(
                        endpoint.getServiceName(), endpoint.getEndpointName());
            }
        }
        
    
private voiddebug(java.util.logging.Level logLevel, java.lang.String msgID)

        logger.log(logLevel, msgID);
    
public BridgegetBridge()

        return bridge;
    
public javax.jbi.messaging.DeliveryChannelgetDeliveryChannel()

        return seDeliveryChannel;
    
public static com.sun.enterprise.jbi.serviceengine.core.JavaEEServiceEngineContextgetInstance()

        return serviceEngineContext;
    
public javax.jbi.component.ComponentContextgetJBIContext()
Returns the context provided by the JBI environment to the service engine

        return jbiContext;
    
public EndpointRegistrygetRegistry()
Gets the ServiceEndpoint Registry

        return endpointRegistry;
    
public com.sun.enterprise.jbi.serviceengine.work.WorkManagerImplgetWorkManager()

        return workManager;
    
public voidinitialize()

        endpointRegistry = EndpointRegistry.getInstance();
        config = new ComponentConfiguration();
        workManager = new WorkManagerImpl(config);
        bridge = config.getBridge();
        bridge.initialize();
    
public booleanisServiceMix()

        String ESBRuntimeProp = System.getProperty("com.sun.enterprise.jbi.se.esbruntime");
        if(ESBRuntimeProp != null && ESBRuntimeProp.equalsIgnoreCase("servicemix")) {
            return true;
        }
        return false;
    
public booleanisSunESB()

         /*
         if(jbiContext == null ||
             !"com.sun.jbi.framework.ComponentContext".equals(jbiContext.getClass().getName())) {
             return false;
         }
          */
        
        String ESBRuntimeProp = System.getProperty("com.sun.enterprise.jbi.se.esbruntime");
        if(ESBRuntimeProp != null && !ESBRuntimeProp.equalsIgnoreCase("sunesb")) {
            return false;
        }
        return true;
    
public voidsetJBIContext(javax.jbi.component.ComponentContext context)

        jbiContext = context;
        seDeliveryChannel = jbiContext.getDeliveryChannel();
        debug(Level.FINE, "Delivery Channel is : " + seDeliveryChannel);