Package org.apache.openejb.config.sys

Examples of org.apache.openejb.config.sys.Resources


    public static void readResourcesXml(Module module) {
        URL url = getUrl(module, "resources.xml");
        if (url != null) {
            try {
                Resources openejb = JaxbOpenejb.unmarshal(Resources.class, IO.read(url));
                module.initResources(openejb);

                // warn if other entities than resources were declared
                if (openejb.getContainer().size() > 0) {
                    logger.warning("containers can't be declared at module level");
                }
                if (openejb.getConnectionManager() != null) {
                    logger.warning("connection manager can't be declared at module level");
                }
                if (openejb.getJndiProvider().size() > 0) {
                    logger.warning("jndi providers can't be declared at module level");
                }
            } catch (Exception e) {
                logger.warning("can't read " + url.toString() + " to load resources for module " + module.toString(), e);
            }
View Full Code Here


    private void readOpenEJBXml(Module module) {
        URL url = getUrl(module, "resources.xml");
        if (url != null) {
            try {
                Resources openejb = JaxbOpenejb.unmarshal(Resources.class, url.openStream());
                module.initResources(openejb);

                // warn if other entities than resources were declared
                if (openejb.getContainer().size() > 0) {
                    logger.warning("containers can't be declared at module level");
                }
                if (openejb.getConnectionManager() != null) {
                    logger.warning("connection manager can't be declared at module level");
                }
                if (openejb.getJndiProvider().size() > 0) {
                    logger.warning("jndi providers can't be declared at module level");
                }
            } catch (Exception e) {
                logger.warning("can't read " + url.toString() + " to load resources for module " + module.toString(), e);
            }
View Full Code Here

    private void readOpenEJBXml(Module module) {
        URL url = getUrl(module, "resources.xml");
        if (url != null) {
            try {
                Resources openejb = JaxbOpenejb.unmarshal(Resources.class, url.openStream());
                module.initResources(openejb);

                // warn if other entities than resources were declared
                if (openejb.getContainer().size() > 0) {
                    logger.warning("containers can't be declared at module level");
                }
                if (openejb.getConnectionManager() != null) {
                    logger.warning("connection manager can't be declared at module level");
                }
                if (openejb.getJndiProvider().size() > 0) {
                    logger.warning("jndi providers can't be declared at module level");
                }
            } catch (Exception e) {
                logger.warning("can't read " + url.toString() + " to load resources for module " + module.toString(), e);
            }
View Full Code Here

        properties.setProperty(CxfRsHttpListener.CXF_JAXRS_PREFIX + CxfUtil.FEATURES, "my-feature");

        final EjbModule module = new EjbModule(ejbJar);
        module.setOpenejbJar(openejbJar);

        final Resources resources = new Resources();

        final Service feature = new Service("my-feature", null);
        feature.setClassName(MyFeature.class.getName());
        resources.getService().add(feature);

        module.initResources(resources);

        return module;
    }
View Full Code Here

    public static EjbModule service() throws Exception {
        final EjbModule module = new EjbModule(new EjbJar(), new OpenejbJar());
        final EnterpriseBean bean = new SingletonBean(AdvancedBean.class).localBean();
        module.getEjbJar().addEnterpriseBean(bean);

        final Resources resources = new Resources();

        final Service feature = new Service("xml", null);
        feature.setClassName(JAXBElementProvider.class.getName());
        feature.getProperties().put("eventHandler", "$handler");
        resources.getService().add(feature);

        final Service handler = new Service("handler", null);
        handler.setClassName(MyValidator.class.getName());
        resources.getService().add(handler);

        module.initResources(resources);

        final PojoDeployment e = new PojoDeployment();
        e.setClassName("jaxrs-application");
View Full Code Here

    public static void readResourcesXml(final Module module) {
        { // xml
            final Source url = getSource(module.getAltDDs().get("resources.xml"));
            if (url != null) {
                try {
                    final Resources openejb = JaxbOpenejb.unmarshal(Resources.class, url.get());
                    module.initResources(openejb);
                } catch (final Exception e) {
                    logger.warning("can't read " + url.toString() + " to load resources for module " + module.toString(), e);
                }
            }
        }
        { // json
            final Source url = getSource(module.getAltDDs().get("resources.json"));
            if (url != null) {
                try {
                    final Resources openejb = JSonConfigReader.read(Resources.class, url.get());
                    module.initResources(openejb);
                } catch (final Exception e) {
                    logger.warning("can't read " + url.toString() + " to load resources for module " + module.toString(), e);
                }
            }
View Full Code Here

        properties.setProperty("cxf.jaxws.properties", "my-props");

        final EjbModule module = new EjbModule(jar);
        module.setOpenejbJar(openejbJar);

        final Resources resources = new Resources();

        final Service service = new Service("my-feature", null, null, null);
        service.setClassName(MyFeature.class.getName());
        resources.add(service);

        final Service myProps = new Service("my-props", null, null, null);
        myProps.setClassName(Properties.class.getName());
        myProps.getProperties().setProperty("faultStackTraceEnabled", "true");
        resources.add(myProps);

        module.initResources(resources);

        return module;
    }
View Full Code Here

    public static void readResourcesXml(final Module module) {
        { // xml
            final Source url = getSource(module.getAltDDs().get("resources.xml"));
            if (url != null) {
                try {
                    final Resources openejb = JaxbOpenejb.unmarshal(Resources.class, url.get());
                    module.initResources(openejb);
                } catch (final Exception e) {
                    logger.warning("can't read " + url.toString() + " to load resources for module " + module.toString(), e);
                }
            }
        }
        { // json
            final Source url = getSource(module.getAltDDs().get("resources.json"));
            if (url != null) {
                try {
                    final Resources openejb = JSonConfigReader.read(Resources.class, url.get());
                    module.initResources(openejb);
                } catch (final Exception e) {
                    logger.warning("can't read " + url.toString() + " to load resources for module " + module.toString(), e);
                }
            }
View Full Code Here

    public static void readResourcesXml(final Module module) {
        { // xml
            final Source url = getSource(module.getAltDDs().get("resources.xml"));
            if (url != null) {
                try {
                    final Resources openejb = JaxbOpenejb.unmarshal(Resources.class, url.get());
                    module.initResources(openejb);
                } catch (final Exception e) {
                    logger.warning("can't read " + url.toString() + " to load resources for module " + module.toString(), e);
                }
            }
        }
        { // json
            final Source url = getSource(module.getAltDDs().get("resources.json"));
            if (url != null) {
                try {
                    final Resources openejb = JSonConfigReader.read(Resources.class, url.get());
                    module.initResources(openejb);
                } catch (final Exception e) {
                    logger.warning("can't read " + url.toString() + " to load resources for module " + module.toString(), e);
                }
            }
View Full Code Here

    public static void readResourcesXml(final Module module) {
        { // xml
            final Source url = getSource(module.getAltDDs().get("resources.xml"));
            if (url != null) {
                try {
                    final Resources openejb = JaxbOpenejb.unmarshal(Resources.class, url.get());
                    module.initResources(openejb);
                } catch (Exception e) {
                    logger.warning("can't read " + url.toString() + " to load resources for module " + module.toString(), e);
                }
            }
        }
        { // json
            final Source url = getSource(module.getAltDDs().get("resources.json"));
            if (url != null) {
                try {
                    final Resources openejb = JSonConfigReader.read(Resources.class, url.get());
                    module.initResources(openejb);
                } catch (Exception e) {
                    logger.warning("can't read " + url.toString() + " to load resources for module " + module.toString(), e);
                }
            }
View Full Code Here

TOP

Related Classes of org.apache.openejb.config.sys.Resources

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.