/** * Create a new HttpsConnector * * @param parent MBean Name of the associated parent component * @param address The IP address on which to bind * @param port TCP port number to listen on * * @exception Exception if an MBean cannot be created or registered */ public String createHttpsConnector(String parent, String address, int port) throws Exception { return createConnector(parent, address, port, false, true); }
/** * Create a new StandardContext. * * @param parent MBean Name of the associated parent component * @param path The context path for this Context * @param docBase Document base directory (or WAR) for this Context * * @exception Exception if an MBean cannot be created or registered */ public String createStandardContext(String parent, String path, String docBase) throws Exception { return createStandardContext(parent, path, docBase, false, false); }
/** * Remove an existing Realm. * * @param name MBean Name of the component to remove * * @exception Exception if a component cannot be removed */ public void removeRealm(String name) throws Exception { ObjectName oname = new ObjectName(name); // Acquire a reference to the component to be removed Container container = getParentContainerFromChild(oname); container.setRealm(null); }
Service service = getService(pname); StandardEngine engine = (StandardEngine) service.getContainer(); if ((j2eeType!=null) && (j2eeType.equals("WebModule"))) { String path = name.substring(i); Container host = engine.findChild(hostName); String pathStr = getPathStr(path); Container context = host.findChild(pathStr); return context;
MBeanFactory factory = new MBeanFactory(); factory.setContainer(this); onameMBeanFactory = register(factory, "type=MBeanFactory");
private String addRealmToParent(String parent, Realm realm) throws Exception { ObjectName pname = new ObjectName(parent); Container container = getParentContainerFromParent(pname); // Add the new instance to its parent component container.setRealm(realm); // Return the corresponding MBean name ObjectName oname = null; if (realm instanceof JmxEnabled) { oname = ((JmxEnabled) realm).getObjectName(); } if (oname != null) { return oname.toString(); } else { return null; } }
/** * Remove an existing Service. * * @param name MBean Name of the component to remove * * @exception Exception if a component cannot be removed */ public void removeService(String name) throws Exception { if (!(container instanceof Server)) { throw new Exception(); } // Acquire a reference to the component to be removed ObjectName oname = new ObjectName(name); Service service = getService(oname); ((Server) container).removeService(service); }
/** * Create the MBeans that correspond to every existing node of our tree. */ protected void createMBeans() { try { MBeanFactory factory = new MBeanFactory(); createMBeans(factory); createMBeans(ServerFactory.getServer()); } catch (MBeanException t) { Exception e = t.getTargetException(); if (e == null) e = t; log.error("createMBeans: MBeanException", e); } catch (Throwable t) { log.error("createMBeans: Throwable", t); } }
Service service = getService(pname); StandardEngine engine = (StandardEngine) service.getContainer(); if ((j2eeType!=null) && (j2eeType.equals("WebModule"))) { String path = name.substring(i); Host host = (Host) engine.findChild(hostName); String pathStr = getPathStr(path); StandardContext context = (StandardContext)host.findChild(pathStr); return context;
/** * Invoke a pre-startup initialization. This is used to allow connectors * to bind to restricted ports under Unix operating environments. */ @Override protected void initInternal() throws LifecycleException { super.initInternal(); // Register global String cache // Note although the cache is global, if there are multiple Servers // present in the JVM (may happen when embedding) then the same cache // will be registered under multiple names onameStringCache = register(new StringCache(), "type=StringCache"); // Register the MBeanFactory MBeanFactory factory = new MBeanFactory(); factory.setContainer(this); onameMBeanFactory = register(factory, "type=MBeanFactory"); // Register the naming resources onameNamingResoucres = register(globalNamingResources, "type=NamingResources"); // Initialize our defined Services for (int i = 0; i < services.length; i++) { services[i].init(); } }
private String addRealmToParent(String parent, Realm realm) throws Exception { ObjectName pname = new ObjectName(parent); Container container = getParentContainerFromParent(pname); // Add the new instance to its parent component container.setRealm(realm); // Return the corresponding MBean name ObjectName oname = null; if (realm instanceof JmxEnabled) { oname = ((JmxEnabled) realm).getObjectName(); } if (oname != null) { return oname.toString(); } else { return null; } }
/** * Remove an existing Service. * * @param name MBean Name of the component to remove * * @exception Exception if a component cannot be removed */ public void removeService(String name) throws Exception { if (!(container instanceof Server)) { throw new Exception(); } // Acquire a reference to the component to be removed ObjectName oname = new ObjectName(name); Service service = getService(oname); ((Server) container).removeService(service); }
MBeanFactory factory = new MBeanFactory(); createMBeans(factory); createMBeans((Service)lifecycle);
Service service = getService(pname); StandardEngine engine = (StandardEngine) service.getContainer(); if ((j2eeType!=null) && (j2eeType.equals("WebModule"))) { String path = name.substring(i); Host host = (Host) engine.findChild(hostName); String pathStr = getPathStr(path); StandardContext context = (StandardContext)host.findChild(pathStr); return context;
/** * Invoke a pre-startup initialization. This is used to allow connectors * to bind to restricted ports under Unix operating environments. */ @Override protected void initInternal() throws LifecycleException { super.initInternal(); // Register global String cache // Note although the cache is global, if there are multiple Servers // present in the JVM (may happen when embedding) then the same cache // will be registered under multiple names onameStringCache = register(new StringCache(), "type=StringCache"); // Register the MBeanFactory MBeanFactory factory = new MBeanFactory(); factory.setContainer(this); onameMBeanFactory = register(factory, "type=MBeanFactory"); // Register the naming resources onameNamingResoucres = register(globalNamingResources, "type=NamingResources"); // Initialize our defined Services for (int i = 0; i < services.length; i++) { services[i].init(); } }
/** * Remove an existing Realm. * * @param name MBean Name of the component to remove * * @exception Exception if a component cannot be removed */ public void removeRealm(String name) throws Exception { ObjectName oname = new ObjectName(name); // Acquire a reference to the component to be removed Container container = getParentContainerFromChild(oname); container.setRealm(null); }
/** * Create a new AjpConnector * * @param parent MBean Name of the associated parent component * @param address The IP address on which to bind * @param port TCP port number to listen on * * @exception Exception if an MBean cannot be created or registered */ public String createAjpConnector(String parent, String address, int port) throws Exception { return createConnector(parent, address, port, true, false); }
/** * Create a new Single Sign On Valve. * * @param parent MBean Name of the associated parent component * * @exception Exception if an MBean cannot be created or registered */ public String createSingleSignOn(String parent) throws Exception { // Create a new SingleSignOn instance SingleSignOn valve = new SingleSignOn(); // Add the new instance to its parent component ObjectName pname = new ObjectName(parent); ContainerBase containerBase = getParentContainerFromParent(pname); containerBase.addValve(valve); ObjectName oname = valve.getObjectName(); return (oname.toString()); }
/** * Remove an existing Service. * * @param name MBean Name of the component to remove * * @exception Exception if a component cannot be removed */ public void removeService(String name) throws Exception { if (!(container instanceof Server)) { throw new Exception(); } // Acquire a reference to the component to be removed ObjectName oname = new ObjectName(name); Service service = getService(oname); ((Server) container).removeService(service); }
/** * Create a new StandardContext. * * @param parent MBean Name of the associated parent component * @param path The context path for this Context * @param docBase Document base directory (or WAR) for this Context * @return the object name of the created context * * @exception Exception if an MBean cannot be created or registered */ public String createStandardContext(String parent, String path, String docBase) throws Exception { return createStandardContext(parent, path, docBase, false, false); }