Search in sources :

Example 1 with DiscoveryAgent

use of org.apache.openejb.server.DiscoveryAgent in project tomee by apache.

the class EjbDaemon method init.

public void init(final Properties props) throws Exception {
    containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
    // deploymentIndex = new DeploymentIndex(containerSystem.deployments());
    clientObjectFactory = new ClientObjectFactory(this, props);
    ejbHandler = new EjbRequestHandler(this);
    jndiHandler = new JndiRequestHandler(this);
    authHandler = new AuthRequestHandler(this);
    logoutHandler = new LogoutRequestHandler(this);
    clusterHandler = new ClusterRequestHandler(this);
    gzip = "true".equalsIgnoreCase(props.getProperty("gzip", "false"));
    try {
        this.timeout = Integer.parseInt(props.getProperty("timeout", "14400000"));
    } catch (Exception e) {
    // Ignore
    }
    final String serializer = props.getProperty("serializer", null);
    if (serializer != null) {
        try {
            this.serializer = EJBDSerializer.class.cast(Thread.currentThread().getContextClassLoader().loadClass(serializer).newInstance());
        } catch (final ClassNotFoundException | NoClassDefFoundError cnfe) {
            // let's try later with app classloader
            this.serializer = new ContextualSerializer(serializer);
        }
    }
    final DiscoveryAgent discovery = SystemInstance.get().getComponent(DiscoveryAgent.class);
    if (discovery != null) {
        discovery.setDiscoveryListener(clusterHandler);
    }
    countStreams = Boolean.parseBoolean(props.getProperty("stream.count", Boolean.toString(jndiHandler.isDebug())));
    securityService = SystemInstance.get().getComponent(SecurityService.class);
}
Also used : ContainerSystem(org.apache.openejb.spi.ContainerSystem) IOException(java.io.IOException) RemoteException(java.rmi.RemoteException) OpenEJBRuntimeException(org.apache.openejb.OpenEJBRuntimeException) DiscoveryAgent(org.apache.openejb.server.DiscoveryAgent) SecurityService(org.apache.openejb.spi.SecurityService) EJBDSerializer(org.apache.openejb.client.serializer.EJBDSerializer)

Aggregations

IOException (java.io.IOException)1 RemoteException (java.rmi.RemoteException)1 OpenEJBRuntimeException (org.apache.openejb.OpenEJBRuntimeException)1 EJBDSerializer (org.apache.openejb.client.serializer.EJBDSerializer)1 DiscoveryAgent (org.apache.openejb.server.DiscoveryAgent)1 ContainerSystem (org.apache.openejb.spi.ContainerSystem)1 SecurityService (org.apache.openejb.spi.SecurityService)1