rootContext.setLoader(loader); rootContext.setReloadable(true);
rootContext.setLoader(loader); rootContext.setReloadable(true);
/** * Remove an existing Loader. * * @param name MBean Name of the component to remove * * @exception Exception if a component cannot be removed */ public void removeLoader(String name) throws Exception { ObjectName oname = new ObjectName(name); // Acquire a reference to the component to be removed Container container = getParentContainerFromChild(oname); if (container instanceof Context) { ((Context) container).setLoader(null); } }
/** * Remove an existing Loader. * * @param name MBean Name of the component to remove * * @exception Exception if a component cannot be removed */ public void removeLoader(String name) throws Exception { ObjectName oname = new ObjectName(name); // Acquire a reference to the component to be removed Container container = getParentContainerFromChild(oname); if (container instanceof Context) { ((Context) container).setLoader(null); } }
/** * Remove an existing Loader. * * @param name MBean Name of the component to remove * * @exception Exception if a component cannot be removed */ public void removeLoader(String name) throws Exception { ObjectName oname = new ObjectName(name); // Acquire a reference to the component to be removed Container container = getParentContainerFromChild(oname); if (container instanceof Context) { ((Context) container).setLoader(null); } }
public Meecrowave deployClasspath(final DeploymentMeta meta) { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); final ClassLoader parentLoader = tomcat.getServer().getParentClassLoader(); if (parentLoader.getParent() == classLoader) { classLoader = parentLoader; } final ProvidedLoader loader = new ProvidedLoader(classLoader, configuration.isTomcatWrapLoader()); final Consumer<Context> builtInCustomizer = c -> { c.setLoader(loader); configuration.getInitializers().forEach(i -> c.addServletContainerInitializer(i, emptySet())); }; return deployWebapp(new DeploymentMeta(meta.context, meta.docBase, ofNullable(meta.consumer).map(c -> (Consumer<Context>) ctx -> { builtInCustomizer.accept(ctx); c.accept(ctx); }).orElse(builtInCustomizer))); }
public Meecrowave deployClasspath(final DeploymentMeta meta) { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); final ClassLoader parentLoader = tomcat.getServer().getParentClassLoader(); if (parentLoader.getParent() == classLoader) { classLoader = parentLoader; } final ProvidedLoader loader = new ProvidedLoader(classLoader, configuration.isTomcatWrapLoader()); final Consumer<Context> builtInCustomizer = c -> { c.setLoader(loader); configuration.getInitializers().forEach(i -> c.addServletContainerInitializer(i, emptySet())); }; return deployWebapp(new DeploymentMeta(meta.context, meta.docBase, ofNullable(meta.consumer).map(c -> (Consumer<Context>) ctx -> { builtInCustomizer.accept(ctx); c.accept(ctx); }).orElse(builtInCustomizer))); }
/** * Create a new Web Application Loader. * * @param parent MBean Name of the associated parent component * * @exception Exception if an MBean cannot be created or registered */ public String createWebappLoader(String parent) throws Exception { // Create a new WebappLoader instance WebappLoader loader = new WebappLoader(); // Add the new instance to its parent component ObjectName pname = new ObjectName(parent); Container container = getParentContainerFromParent(pname); if (container instanceof Context) { ((Context) container).setLoader(loader); } // FIXME add Loader.getObjectName //ObjectName oname = loader.getObjectName(); ObjectName oname = MBeanUtils.createObjectName(pname.getDomain(), loader); return (oname.toString()); }
/** * Create a new Web Application Loader. * * @param parent MBean Name of the associated parent component * @return the object name of the created loader * * @exception Exception if an MBean cannot be created or registered */ public String createWebappLoader(String parent) throws Exception { // Create a new WebappLoader instance WebappLoader loader = new WebappLoader(); // Add the new instance to its parent component ObjectName pname = new ObjectName(parent); Container container = getParentContainerFromParent(pname); if (container instanceof Context) { ((Context) container).setLoader(loader); } // FIXME add Loader.getObjectName //ObjectName oname = loader.getObjectName(); ObjectName oname = MBeanUtils.createObjectName(pname.getDomain(), loader); return oname.toString(); }
/** * Create a new Web Application Loader. * * @param parent MBean Name of the associated parent component * @return the object name of the created loader * * @exception Exception if an MBean cannot be created or registered */ public String createWebappLoader(String parent) throws Exception { // Create a new WebappLoader instance WebappLoader loader = new WebappLoader(); // Add the new instance to its parent component ObjectName pname = new ObjectName(parent); Container container = getParentContainerFromParent(pname); if (container instanceof Context) { ((Context) container).setLoader(loader); } // FIXME add Loader.getObjectName //ObjectName oname = loader.getObjectName(); ObjectName oname = MBeanUtils.createObjectName(pname.getDomain(), loader); return oname.toString(); }
@Override public void addWebAppContext( final String contextPath, final String location, final boolean cookies) { final Context context = container.createContext(contextPath, location); context.setLoader(webAppLoader); context.setReloadable(true); context.setCookies(cookies); localHost.addChild(context); }
context.setLoader( webappLoader );
public void startPeopleService() throws Exception { final File base = createBaseDirectory(); log.info("Using base folder: " + base.getAbsolutePath()); final Tomcat tomcat = new Tomcat(); tomcat.setPort(8080); tomcat.setBaseDir(base.getAbsolutePath()); Context context = tomcat.addContext("/", base.getAbsolutePath()); Tomcat.addServlet(context, "CXFServlet", new CXFServlet()); context.addServletMapping("/rest/*", "CXFServlet"); context.addApplicationListener(ContextLoaderListener.class.getName()); context.setLoader(new WebappLoader(Thread.currentThread().getContextClassLoader())); context.addParameter("contextClass", AnnotationConfigWebApplicationContext.class.getName()); context.addParameter("contextConfigLocation", AppConfig.class.getName()); tomcat.start(); tomcat.getServer().await(); }
public static void main(final String[] args) throws Exception { final File base = createBaseDirectory(); log.info("Using base folder: " + base.getAbsolutePath()); final Tomcat tomcat = new Tomcat(); tomcat.setPort(8080); tomcat.setBaseDir( base.getAbsolutePath() ); Context context = tomcat.addContext( "/", base.getAbsolutePath() ); Tomcat.addServlet( context, "CXFServlet", new CXFServlet() ); context.addServletMapping( "/rest/*", "CXFServlet" ); context.addApplicationListener( ContextLoaderListener.class.getName() ); context.setLoader( new WebappLoader( Thread.currentThread().getContextClassLoader() ) ); context.addParameter( "contextClass", AnnotationConfigWebApplicationContext.class.getName() ); context.addParameter( "contextConfigLocation", MusicConfig.class.getName() ); tomcat.start(); tomcat.getServer().await(); }
public static void main(final String[] args) throws Exception { final File base = createBaseDirectory(); log.info("Using base folder: " + base.getAbsolutePath()); final Tomcat tomcat = new Tomcat(); tomcat.setPort(8080); tomcat.setBaseDir( base.getAbsolutePath() ); Context context = tomcat.addContext( "/", base.getAbsolutePath() ); Tomcat.addServlet( context, "CXFServlet", new CXFServlet() ); context.addServletMapping( "/rest/*", "CXFServlet" ); context.addApplicationListener( ContextLoaderListener.class.getName() ); context.setLoader( new WebappLoader( Thread.currentThread().getContextClassLoader() ) ); context.addParameter( "contextClass", AnnotationConfigWebApplicationContext.class.getName() ); context.addParameter( "contextConfigLocation", MusicConfig.class.getName() ); tomcat.start(); tomcat.getServer().await(); }
public void startPeopleService() throws Exception { final File base = createBaseDirectory(); log.info("Using base folder: " + base.getAbsolutePath()); final Tomcat tomcat = new Tomcat(); tomcat.setPort(8080); tomcat.setBaseDir(base.getAbsolutePath()); Context context = tomcat.addContext("/", base.getAbsolutePath()); Tomcat.addServlet(context, "CXFServlet", new CXFServlet()); context.addServletMapping("/rest/*", "CXFServlet"); context.addApplicationListener(ContextLoaderListener.class.getName()); context.setLoader(new WebappLoader(Thread.currentThread().getContextClassLoader())); context.addParameter("contextClass", AnnotationConfigWebApplicationContext.class.getName()); context.addParameter("contextConfigLocation", AppConfig.class.getName()); tomcat.start(); tomcat.getServer().await(); }
protected WarDeployment createDeployment(Bundle bundle, String contextPath) throws Exception { String docBase = createDocBase(bundle, contextPath); Context catalinaContext = createDefaultContext(contextPath, docBase); catalinaContext.setLoader(createCatalinaLoader(bundle)); catalinaContext.setPrivileged(false); catalinaContext.setReloadable(false); // create Tomcat specific deployment TomcatWarDeployment deployment = new TomcatWarDeployment(new TomcatContextUndeployer() { public void undeploy(Context catalinaContext) throws OsgiWarDeploymentException { stopCatalinaContext(catalinaContext); } }, bundle, catalinaContext); return deployment; }
ctx.setLoader(wldr);
protected WarDeployment createDeployment(Bundle bundle, String contextPath) throws Exception { String docBase = createDocBase(bundle, contextPath); Context catalinaContext = createDefaultContext(contextPath, docBase); catalinaContext.setLoader(createCatalinaLoader(bundle)); catalinaContext.setPrivileged(false); catalinaContext.setReloadable(false); // create Tomcat specific deployment TomcatWarDeployment deployment = new TomcatWarDeployment(new TomcatContextUndeployer() { public void undeploy(Context catalinaContext) throws OsgiWarDeploymentException { stopCatalinaContext(catalinaContext); } }, bundle, catalinaContext); return deployment; }
context.setLoader( webappLoader ); File contextFile = getContextFile(); if ( contextFile != null )