Package org.apache.openejb.assembler.classic.event

Examples of org.apache.openejb.assembler.classic.event.AssemblerAfterApplicationCreated


            }

            deployedApplications.put(appInfo.path, appInfo);
            resumePersistentSchedulers(appContext);

            systemInstance.fireEvent(new AssemblerAfterApplicationCreated(appInfo, appContext, allDeployments));
            logger.info("createApplication.success", appInfo.path);

            return appContext;
        } catch (final ValidationException ve) {
            throw ve;
View Full Code Here


        final CxfRSService server = new CxfRSService();
        try {
            server.init(new Properties());
            server.start();

            server.afterApplicationCreated(new AssemblerAfterApplicationCreated(info, context, Collections.<BeanContext>emptyList()));

            {
                final ClassLoader beforeLoader = SystemInstance.get().getComponent(ContainerSystem.class).getWebContext("test").getClassLoader();
                assertSame(loader, beforeLoader);
                assertNotNull(beforeLoader);
                assertNotNull(Reflections.get(beforeLoader, "parent")); // getParent != parent from WebAppClassLoader
            }

            loader.internalStop();

            server.undeploy(new AssemblerBeforeApplicationDestroyed(info, context));

            {
                final ClassLoader afterLoader = SystemInstance.get().getComponent(ContainerSystem.class).getWebContext("test").getClassLoader();
                assertSame(loader, afterLoader);
                assertNotNull(afterLoader);
                assertNull(Reflections.get(afterLoader, "parent"));
            }

            loader.start();
            // TomcatWebAppBuilder ill catch start event from StandardContext and force a classloader
            Reflections.set(loader, "parent", ParentClassLoaderFinder.Helper.get());

            server.afterApplicationCreated(new AssemblerAfterApplicationCreated(info, context, Collections.<BeanContext>emptyList()));

            {
                final ClassLoader afterLoader = SystemInstance.get().getComponent(ContainerSystem.class).getWebContext("test").getClassLoader();
                assertSame(loader, afterLoader);
                assertNotNull(afterLoader);
View Full Code Here

        registry = setRegistry();

        final Assembler assembler = SystemInstance.get().getComponent(Assembler.class);
        if (assembler != null) {
            for (final AppInfo appInfo : assembler.getDeployedApplications()) {
                deploy(new AssemblerAfterApplicationCreated(appInfo, SystemInstance.get().getComponent(ContainerSystem.class).getAppContext(appInfo.appId), null));
            }
        }
    }
View Full Code Here

        assembler = SystemInstance.get().getComponent(Assembler.class);
        if (assembler != null) {
            SystemInstance.get().addObserver(this);
            for (final AppInfo appInfo : assembler.getDeployedApplications()) {
                final AppContext appContext = containerSystem.getAppContext(appInfo.appId);
                afterApplicationCreated(new AssemblerAfterApplicationCreated(appInfo, appContext, null));
            }
        }
    }
View Full Code Here

        SystemInstance.get().setComponent(WsService.class, this);
        if (assembler != null) {
            SystemInstance.get().addObserver(this);
            for (final AppInfo appInfo : assembler.getDeployedApplications()) {
                final AppContext appContext = containerSystem.getAppContext(appInfo.appId);
                deploy(new AssemblerAfterApplicationCreated(appInfo, appContext, null));
            }
        }
    }
View Full Code Here

            }

            deployedApplications.put(appInfo.path, appInfo);
            resumePersistentSchedulers(appContext);

            systemInstance.fireEvent(new AssemblerAfterApplicationCreated(appInfo, appContext, allDeployments));
            logger.info("createApplication.success", appInfo.path);

            return appContext;
        } catch (final ValidationException ve) {
            throw ve;
View Full Code Here

            }

            deployedApplications.put(appInfo.path, appInfo);
            resumePersistentSchedulers(appContext);

            systemInstance.fireEvent(new AssemblerAfterApplicationCreated(appInfo, appContext, allDeployments));
            logger.info("createApplication.success", appInfo.path);

            return appContext;
        } catch (final ValidationException ve) {
            throw ve;
View Full Code Here

        final CxfRSService server = new CxfRSService();
        try {
            server.init(new Properties());
            server.start();

            server.afterApplicationCreated(new AssemblerAfterApplicationCreated(info, context, Collections.<BeanContext>emptyList()));

            {
                final ClassLoader beforeLoader = SystemInstance.get().getComponent(ContainerSystem.class).getWebContext("test").getClassLoader();
                assertSame(loader, beforeLoader);
                assertNotNull(beforeLoader);
                assertNotNull(Reflections.get(beforeLoader, "parent"));
            }

            loader.internalStop();

            server.undeploy(new AssemblerBeforeApplicationDestroyed(info, context));

            {
                final URLClassLoader afterLoader = URLClassLoader.class.cast(SystemInstance.get().getComponent(ContainerSystem.class).getWebContext("test").getClassLoader());
                assertSame(loader, afterLoader);
                assertNotNull(afterLoader);
                assertEquals(0, afterLoader.getURLs().length);
                assertEquals(LifecycleState.STOPPED, loader.getState());
            }

            final StandardRoot resources = new StandardRoot();
            loader.setResources(resources);
            resources.setContext(new StandardContext() {
                @Override
                public String getDocBase() {
                    final File file = new File("target/foo");
                    file.mkdirs();
                    return file.getAbsolutePath();
                }

                @Override
                public String getMBeanKeyProperties() {
                    return "foo";
                }
                {}});
            resources.start();
            loader.start();
            // TomcatWebAppBuilder ill catch start event from StandardCo1ntext and force a classloader
            Reflections.set(loader, "parent", ParentClassLoaderFinder.Helper.get());

            server.afterApplicationCreated(new AssemblerAfterApplicationCreated(info, context, Collections.<BeanContext>emptyList()));

            {
                final ClassLoader afterLoader = SystemInstance.get().getComponent(ContainerSystem.class).getWebContext("test").getClassLoader();
                assertSame(loader, afterLoader);
                assertNotNull(afterLoader);
View Full Code Here

            }

            deployedApplications.put(appInfo.path, appInfo);
            resumePersistentSchedulers(appContext);

            systemInstance.fireEvent(new AssemblerAfterApplicationCreated(appInfo, appContext, allDeployments));
            logger.info("createApplication.success", appInfo.path);

            return appContext;
        } catch (final ValidationException ve) {
            throw ve;
View Full Code Here

                    deployMBean(appContext.getWebBeansContext(), classLoader, mbean, appInfo.jmx, appInfo.appId + ".add-lib");
                }
            }

            deployedApplications.put(appInfo.path, appInfo);
            systemInstance.fireEvent(new AssemblerAfterApplicationCreated(appInfo, allDeployments));

            logger.info("createApplication.success", appInfo.path);

            resumePersistentSchedulers(appContext);
View Full Code Here

TOP

Related Classes of org.apache.openejb.assembler.classic.event.AssemblerAfterApplicationCreated

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.