Examples of HessianService


Examples of org.apache.cayenne.remote.hessian.service.HessianService

        MockServletConfig config = new MockServletConfig();
        config.setInitParameter(
                HessianService.EVENT_BRIDGE_FACTORY_PROPERTY,
                MockEventBridgeFactory.class.getName());

        HessianService handler = new HessianService() {

            @Override
            protected void initCayenneStack(Map properties) {
                this.domain = new DataDomain("test");
            }
           
            @Override
            protected HttpSession getSession(boolean create) {
                return new MockHttpSession();
            }
        };

        handler.init(config);
        assertEquals(MockEventBridgeFactory.class.getName(), handler
                .getEventBridgeFactoryName());
    }
View Full Code Here

Examples of org.apache.openejb.server.hessian.HessianService

            }
        }
    }

    protected void deploy(final @Observes AfterDeploymentValidation afterDeploymentValidation, final BeanManager bm) {
        final HessianService service = SystemInstance.get().getComponent(HessianService.class);
        if (service == null) {
            LOGGER.severe("HessianService not yet started, no hessian CDI webservices will be deployed");
            return;
        }

        final HessianRegistry registry = service.getRegistry();

        for (final Deployment deployment : toDeploy) {
            final Hessian hessian = deployment.itf.getAnnotation(Hessian.class);
            final HessianServer server;
            try {
                server = new HessianServer(deployment.bean.getBeanClass().getClassLoader());
            } catch (final HessianServer.HessianIsMissingException e) {
                LOGGER.info("Hessian is not available so openejb-hessian will not deploy any service");
                break;
            }

            try {
                if (hessian != null && hessian.serializerFactory() != Object.class && !hessian.serializerFactory().isInstance(server.getSerializerFactory())) {
                    server.serializerFactory(hessian.serializerFactory().newInstance());
                }
            } catch (final Exception e) {
                throw new OpenEJBRuntimeException(e);
            }
            if (hessian != null) {
                server.sendCollectionType(hessian.sendCollectionType());
            }
            if (Dependent.class.equals(deployment.bean.getScope())) {
                LOGGER.warning("@Dependent can lead to memory leaks ATM");
            }
            server.createSkeleton(bm.getReference(deployment.bean, deployment.itf, null), deployment.itf);

            final String name = getName(deployment.path, deployment.itf);
            final String appName = findAppName(bm);
            try {
                LOGGER.info("Hessian(url=" + registry.deploy(deployment.itf.getClassLoader(), server,
                    service.getVirtualHost(), appName,
                    service.getAuthMethod(), service.getTransportGuarantee(),
                    service.getRealmName(), name) + ", interface=" + name + ")");
                deployed.add(new DeployedEndpoint(appName, name));
            } catch (final URISyntaxException e) {
                throw new OpenEJBRuntimeException(e);
            }
        }
View Full Code Here

Examples of org.apache.openejb.server.hessian.HessianService

        return InjectableBeanManager.class.isInstance(bm) && app == InjectableBeanManager.class.cast(bm).getWebBeansContext()
            || BeanManagerImpl.class.isInstance(bm) && app == BeanManagerImpl.class.cast(bm).getWebBeansContext();
    }

    protected void shutdown(final @Observes BeforeShutdown unused) {
        final HessianService service = SystemInstance.get().getComponent(HessianService.class);
        if (service == null) {
            return;
        }

        final HessianRegistry registry = service.getRegistry();
        for (final DeployedEndpoint pair : deployed) {
            registry.undeploy(service.getVirtualHost(), pair.app, pair.name);
            LOGGER.info("Undeployed CDI hessian service " + pair.name);
        }
        deployed.clear();
    }
View Full Code Here

Examples of org.apache.openejb.server.hessian.HessianService

            }
        }
    }

    protected void deploy(final @Observes AfterDeploymentValidation afterDeploymentValidation, final BeanManager bm) {
        final HessianService service = SystemInstance.get().getComponent(HessianService.class);
        if (service == null) {
            LOGGER.severe("HessianService not yet started, no hessian CDI webservices will be deployed");
            return;
        }

        final HessianRegistry registry = service.getRegistry();

        final String appName = findAppName();
        for (final Deployment deployment : toDeploy) {
            final Hessian hessian = deployment.itf.getAnnotation(Hessian.class);
            final HessianServer server;
            try {
                server = new HessianServer(deployment.bean.getBeanClass().getClassLoader());
            } catch (final HessianServer.HessianIsMissingException e) {
                LOGGER.info("Hessian is not available so openejb-hessian will not deploy any service");
                break;
            }

            try {
                if (hessian != null && hessian.serializerFactory() != Object.class && !hessian.serializerFactory().isInstance(server.getSerializerFactory())) {
                    server.serializerFactory(hessian.serializerFactory().newInstance());
                }
            } catch (final Exception e) {
                throw new OpenEJBRuntimeException(e);
            }
            if (hessian != null) {
                server.sendCollectionType(hessian.sendCollectionType());
            }
            if (Dependent.class.equals(deployment.bean.getScope())) {
                LOGGER.warning("@Dependent can lead to memory leaks ATM");
            }
            server.createSkeleton(bm.getReference(deployment.bean, deployment.itf, null), deployment.itf);

            final String name = getName(deployment.path, deployment.itf);
            try {
                LOGGER.info("Hessian(url=" + registry.deploy(deployment.itf.getClassLoader(), server,
                    service.getVirtualHost(), appName,
                    service.getAuthMethod(), service.getTransportGuarantee(),
                    service.getRealmName(), name) + ", interface=" + name + ")");
                deployed.add(new DeployedEndpoint(appName, name));
            } catch (final URISyntaxException e) {
                throw new OpenEJBRuntimeException(e);
            }
        }
View Full Code Here

Examples of org.apache.openejb.server.hessian.HessianService

            return false;
        }
    }

    protected void shutdown(final @Observes BeforeShutdown unused) {
        final HessianService service = SystemInstance.get().getComponent(HessianService.class);
        if (service == null) {
            return;
        }

        final HessianRegistry registry = service.getRegistry();
        for (final DeployedEndpoint pair : deployed) {
            registry.undeploy(service.getVirtualHost(), pair.app, pair.name);
            LOGGER.info("Undeployed CDI hessian service " + pair.name);
        }
        deployed.clear();
    }
View Full Code Here

Examples of org.apache.openejb.server.hessian.HessianService

        return InjectableBeanManager.class.isInstance(bm) && app == InjectableBeanManager.class.cast(bm).getWebBeansContext()
                || BeanManagerImpl.class.isInstance(bm) && app == BeanManagerImpl.class.cast(bm).getWebBeansContext();
    }

    protected void shutdown(final @Observes BeforeShutdown unused) {
        final HessianService service = SystemInstance.get().getComponent(HessianService.class);
        if (service == null) {
            return;
        }

        final HessianRegistry registry = service.getRegistry();
        for (final DeployedEndpoint pair : deployed) {
            registry.undeploy(service.getVirtualHost(), pair.app, pair.name);
            LOGGER.info("Undeployed CDI hessian service " + pair.name);
        }
        deployed.clear();
    }
View Full Code Here

Examples of org.apache.openejb.server.hessian.HessianService

            }
        }
    }

    protected void deploy(final @Observes AfterDeploymentValidation afterDeploymentValidation, final BeanManager bm) {
        final HessianService service = SystemInstance.get().getComponent(HessianService.class);
        if (service == null) {
            LOGGER.severe("HessianService not yet started, no hessian CDI webservices will be deployed");
            return;
        }

        final HessianRegistry registry = service.getRegistry();

        for (final Deployment deployment : toDeploy) {
            final Hessian hessian = deployment.itf.getAnnotation(Hessian.class);
            final HessianServer server;
            try {
                server = new HessianServer(deployment.bean.getBeanClass().getClassLoader());
            } catch (final HessianServer.HessianIsMissingException e) {
                LOGGER.info("Hessian is not available so openejb-hessian will not deploy any service");
                break;
            }

            try {
                if (hessian != null && hessian.serializerFactory() != Object.class && !hessian.serializerFactory().isInstance(server.getSerializerFactory())) {
                    server.serializerFactory(hessian.serializerFactory().newInstance());
                }
            } catch (final Exception e) {
                throw new OpenEJBRuntimeException(e);
            }
            if (hessian != null) {
                server.sendCollectionType(hessian.sendCollectionType());
            }
            if (Dependent.class.equals(deployment.bean.getScope())) {
                LOGGER.warning("@Dependent can lead to memory leaks ATM");
            }
            server.createSkeleton(bm.getReference(deployment.bean, deployment.itf, null), deployment.itf);

            final String name = getName(deployment.path, deployment.itf);
            final String appName = findAppName(bm);
            try {
                LOGGER.info("Hessian(url=" + registry.deploy(deployment.itf.getClassLoader(), server,
                        service.getVirtualHost(), appName,
                        service.getAuthMethod(), service.getTransportGuarantee(),
                        service.getRealmName(), name) + ", interface=" + name + ")");
                deployed.add(new DeployedEndpoint(appName, name));
            } catch (final URISyntaxException e) {
                throw new OpenEJBRuntimeException(e);
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.