Package org.apache.openejb.assembler.classic.util

Examples of org.apache.openejb.assembler.classic.util.ServiceConfiguration


                    // no-op
                }
            }
        }

        final ServiceConfiguration configuration = new ServiceConfiguration(SystemInstance.get().getProperties(),
            SystemInstance.get().getComponent(OpenEjbConfiguration.class).facilities.services);

        final Collection<ServiceInfo> serviceInfos = configuration.getAvailableServices();
        final Properties properties = configuration.getProperties();
        if (properties == null || properties.isEmpty()) {
            return;
        }

        final String featuresIds = properties.getProperty(BUS_PREFIX + FEATURES);
        if (featuresIds != null) {
            final List<Feature> features = createFeatures(serviceInfos, featuresIds);
            if (features != null) {
                features.addAll(bus.getFeatures());
                bus.setFeatures(features);
            }
        }

        final Properties busProperties = ServiceInfos.serviceProperties(serviceInfos, properties.getProperty(BUS_PREFIX + ENDPOINT_PROPERTIES));
        if (busProperties != null) {
            bus.getProperties().putAll(PropertiesHelper.map(busProperties));
        }

        configureInterceptors(bus, BUS_PREFIX, serviceInfos, configuration.getProperties());

        SystemInstance.get().getProperties().setProperty(BUS_CONFIGURED_FLAG, "true");

        bus.setId(SystemInstance.get().getProperty("openejb.cxf.bus.id", "openejb.cxf.bus"));
    }
View Full Code Here


            return;
        }

        final Bus bus = getDefaultBus();
        if (bus instanceof CXFBusImpl) {
            final ServiceConfiguration configuration = new ServiceConfiguration(SystemInstance.get().getProperties(),
                    SystemInstance.get().getComponent(OpenEjbConfiguration.class).facilities.services);

            final CXFBusImpl busImpl = (CXFBusImpl) bus;
            final Collection<ServiceInfo> serviceInfos = configuration.getAvailableServices();
            final Properties properties = configuration.getProperties();
            if (properties == null || properties.isEmpty()) {
                return;
            }

            final String featuresIds = properties.getProperty(BUS_PREFIX + FEATURES);
            if (featuresIds != null) {
                final List<AbstractFeature> features = createFeatures(serviceInfos, featuresIds);
                if (features != null) {
                    features.addAll(busImpl.getFeatures());
                    busImpl.setFeatures(features);
                }
            }

            final Properties busProperties = ServiceInfos.serviceProperties(serviceInfos, properties.getProperty(BUS_PREFIX + ENDPOINT_PROPERTIES));
            if (busProperties != null) {
                busImpl.getProperties().putAll(PropertiesHelper.map(busProperties));
            }

            configureInterceptors(busImpl, BUS_PREFIX, serviceInfos, configuration.getProperties());

            SystemInstance.get().getProperties().setProperty(BUS_CONFIGURED_FLAG, "true");
        }
    }
View Full Code Here

                        // no more a singleton if the ejb is not a singleton...but it is a weird case
                        deployEJB(webApp.contextRoot, appPrefix, restEjbs.get(o.getClass().getName()).context, additionalProviders, appInfo.services);
                    } else {
                        pojoConfigurations = PojoUtil.findPojoConfig(pojoConfigurations, appInfo, webApp);
                        deploySingleton(webApp.contextRoot, appPrefix, o, appInstance, classLoader, additionalProviders,
                                new ServiceConfiguration(PojoUtil.findConfiguration(pojoConfigurations, o.getClass().getName()), appInfo.services));
                    }
                }

                for (Class<?> clazz : classes) {
                    if (additionalProviders.contains(clazz)) {
                        continue;
                    }

                    if (hasEjbAndIsNotAManagedBean(restEjbs, clazz.getName())) {
                        deployEJB(webApp.contextRoot, appPrefix, restEjbs.get(clazz.getName()).context, additionalProviders, appInfo.services);
                    } else {
                        pojoConfigurations = PojoUtil.findPojoConfig(pojoConfigurations, appInfo, webApp);
                        deployPojo(webApp.contextRoot, appPrefix, clazz, appInstance, classLoader, injections, context, owbCtx, additionalProviders,
                                new ServiceConfiguration(PojoUtil.findConfiguration(pojoConfigurations, clazz.getName()), appInfo.services));
                    }
                }

                useApp = useApp || classes.size() + singletons.size() > 0;
                LOGGER.info("REST application deployed: " + app);
            }

            if (!useApp) {
                if (webApp.restApplications.isEmpty() || webApp.restApplications.size() > 1) {
                    appPrefix = webApp.contextRoot;
                } // else keep application prefix

                final Set<String> restClasses = new HashSet<String>(webApp.restClass);
                restClasses.addAll(webApp.ejbRestServices);

                for (String clazz : restClasses) {
                    if (restEjbs.containsKey(clazz)) {
                        final BeanContext ctx = restEjbs.get(clazz).context;
                        if (hasEjbAndIsNotAManagedBean(restEjbs, clazz)) {
                            deployEJB(webApp.contextRoot, appPrefix, restEjbs.get(clazz).context, additionalProviders, appInfo.services);
                        } else {
                            deployPojo(webApp.contextRoot, appPrefix, ctx.getBeanClass(), null, ctx.getClassLoader(), ctx.getInjections(), context,
                                    owbCtx, additionalProviders, new ServiceConfiguration(ctx.getProperties(), appInfo.services));
                        }
                    } else {
                        try {
                            Class<?> loadedClazz = classLoader.loadClass(clazz);
                            pojoConfigurations = PojoUtil.findPojoConfig(pojoConfigurations, appInfo, webApp);
                            deployPojo(webApp.contextRoot, appPrefix, loadedClazz, null, classLoader, injections, context, owbCtx,
                                    additionalProviders,
                                    new ServiceConfiguration(PojoUtil.findConfiguration(pojoConfigurations, loadedClazz.getName()), appInfo.services));
                        } catch (ClassNotFoundException e) {
                            throw new OpenEJBRestRuntimeException("can't find class " + clazz, e);
                        }
                    }
                }
View Full Code Here

                    final BeanContext ctx = ejb.getValue().context;
                    if (BeanType.MANAGED.equals(ctx.getComponentType())) {
                        deployPojo("", ejb.getValue().path, ctx.getBeanClass(), null, ctx.getClassLoader(), ctx.getInjections(),
                                ctx.getJndiContext(),
                                containerSystem.getAppContext(appInfo.appId).getWebBeansContext(),
                                providers, new ServiceConfiguration(ctx.getProperties(), appInfo.services));
                    } else {
                        deployEJB("", ejb.getValue().path, ctx, providers, appInfo.services);
                    }
                }
                restEjbs.clear();
View Full Code Here

        final RsHttpListener listener = createHttpListener();
        final RsRegistry.AddressInfo address = rsRegistry.createRsHttpListener(web, listener, beanContext.getClassLoader(), nopath.substring(NOPATH_PREFIX.length() - 1), virtualHost);

        services.add(new DeployedService(address.complete, context, beanContext.getBeanClass().getName()));
        listener.deployEJB(getFullContext(address.base, context), beanContext,
                additionalProviders, new ServiceConfiguration(beanContext.getProperties(), serviceInfos));

        LOGGER.info("REST Service: " + address.complete + "  -> EJB " + beanContext.getEjbName());
    }
View Full Code Here

                        final ClassLoader old = Thread.currentThread().getContextClassLoader();
                        Thread.currentThread().setContextClassLoader(beanContext.getClassLoader());
                        try {
                            PortData port = WsBuilder.toPortData(portInfo, beanContext.getInjections(), moduleBaseUrl, beanContext.getClassLoader());

                            HttpListener container = createEjbWsContainer(moduleBaseUrl, port, beanContext, new ServiceConfiguration(beanContext.getProperties(), appInfo.services));

                            // generate a location if one was not assigned
                            String location = port.getLocation();
                            if (location == null) {
                                location = autoAssignWsLocation(bean, port, contextData, deploymentIdTemplate);
View Full Code Here

                pojoConfiguration = PojoUtil.findPojoConfig(pojoConfiguration, appInfo, webApp);

                HttpListener container = createPojoWsContainer(moduleBaseUrl, port, portInfo.serviceLink,
                        target, context, webApp.contextRoot, bindings,
                        new ServiceConfiguration(PojoUtil.findConfiguration(pojoConfiguration, target.getName()), appInfo.services));

                if (wsRegistry != null) {
                    // give servlet a reference to the webservice container
                    List<String> addresses = wsRegistry.setWsContainer(virtualHost, webApp.contextRoot, servlet.servletName, container);
View Full Code Here

TOP

Related Classes of org.apache.openejb.assembler.classic.util.ServiceConfiguration

Copyright © 2018 www.massapicom. 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.