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

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


                }
            }
        }

        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");

            busImpl.setId(SystemInstance.get().getProperty("openejb.cxf.bus.id", "openejb.cxf.bus"));
        }
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 (final 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 (final 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 {
                        final 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 (final ClassNotFoundException e) {
                        throw new OpenEJBRestRuntimeException("can't find class " + clazz, e);
                    }
                }
            }
View Full Code Here

        final RsRegistry.AddressInfo address = rsRegistry.createRsHttpListener(contextRoot, listener, classLoader, nopath.substring(NOPATH_PREFIX.length() - 1), virtualHost, auth, realm);

        services.add(new DeployedService(address.complete, contextRoot, application.getClass().getName()));
        listener.deployApplication(application, address.complete.substring(0, address.complete.length() - wildcard.length()), nopath.substring(NOPATH_PREFIX.length(), nopath.length() - wildcard.length()), additionalProviders, restEjbs, // app config
            classLoader, injections, context, owbCtx, // injection/webapp context
            new ServiceConfiguration(configuration, appInfo.services)); // deployment config
    }
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);
                            }
                        }
                    }
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, auth, realm);

        services.add(new DeployedService(address.complete, context, beanContext.getBeanClass().getName()));
        listener.deployEJB(context, 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 {
                        final PortData port = WsBuilder.toPortData(portInfo, beanContext.getInjections(), moduleBaseUrl, beanContext.getClassLoader());

                        final 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);

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

                if (wsRegistry != null) {
                    String auth = authMethod;
                    String realm = realmName;
                    String transport = transportGuarantee;
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 (final 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 (final 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 {
                        final 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 RsRegistry.AddressInfo address = rsRegistry.createRsHttpListener(contextRoot, listener, classLoader, nopath.substring(NOPATH_PREFIX.length() - 1), virtualHost, auth, realm);

        services.add(new DeployedService(address.complete, contextRoot, application.getClass().getName()));
        listener.deployApplication(application, address.complete.substring(0, address.complete.length() - wildcard.length()), nopath.substring(NOPATH_PREFIX.length(), nopath.length() - wildcard.length()), additionalProviders, restEjbs, // app config
                classLoader, injections, context, owbCtx, // injection/webapp context
                new ServiceConfiguration(configuration, appInfo.services)); // deployment config
    }
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);
                            }
                        }
                    }
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.