CVS: jcontainer/loom/engine/src/java/org/jcontainer/loom/components/manager AbstractJMXManager.java,1.9,1.10 AbstractSystemManager.java,1.8,1.9 MX4JSystemManager.java,1.8,1.9
Peter Donald <pdonald-yCVjj/[email protected]> Sat, 29 Nov 2003 07:44:57 -0600
| Newsgroups | gmane.comp.java.jcontainer.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/jcontainer/jcontainer/loom/engine/src/java/org/jcontainer/loom/components/manager In directory hogshead.codehaus.org:/tmp/cvs-serv31016/loom/engine/src/java/org/jcontainer/loom/components/manager Modified Files: AbstractJMXManager.java AbstractSystemManager.java MX4JSystemManager.java Log Message: Remove email addie Index: AbstractJMXManager.java =================================================================== RCS file: /cvsroot/jcontainer/jcontainer/loom/engine/src/java/org/jcontainer/loom/components/manager/AbstractJMXManager.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- AbstractJMXManager.java 18 Oct 2003 08:11:11 -0000 1.9 +++ AbstractJMXManager.java 29 Nov 2003 13:44:21 -0000 1.10 @@ -98,7 +98,7 @@ /** * An abstract class via which JMX Managers can extend. * - * @author <a href="mailto:peter at realityforge.org">Peter Donald</a> + * @author Peter Donald * @author <a href="mailto:Huw-/[email protected]">Huw Roberts</a> * @version $Revision$ $Date$ */ @@ -125,9 +125,8 @@ } /** - * Export the object to the particular management medium using - * the supplied object and interfaces. - * This needs to be implemented by subclasses. + * Export the object to the particular management medium using the supplied + * object and interfaces. This needs to be implemented by subclasses. * * @param name the name of object * @param object the object @@ -140,12 +139,15 @@ { try { - BINDER.bindMBean( object, createObjectName( name ), getMBeanServer() ); + BINDER.bindMBean( object, + createObjectName( name ), + getMBeanServer() ); return object; } catch( final Exception e ) { - final String message = REZ.format( "jmxmanager.error.export.fail", name ); + final String message = REZ.format( "jmxmanager.error.export.fail", + name ); getLogger().error( message, e ); throw new LoomException( message, e ); } @@ -182,8 +184,8 @@ } /** - * Creates a new MBeanServer. - * The subclass should implement this to create specific MBeanServer. + * Creates a new MBeanServer. The subclass should implement this to create + * specific MBeanServer. */ protected abstract MBeanServer createMBeanServer() throws Exception; Index: AbstractSystemManager.java =================================================================== RCS file: /cvsroot/jcontainer/jcontainer/loom/engine/src/java/org/jcontainer/loom/components/manager/AbstractSystemManager.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- AbstractSystemManager.java 15 Oct 2003 03:46:36 -0000 1.8 +++ AbstractSystemManager.java 29 Nov 2003 13:44:21 -0000 1.9 @@ -96,7 +96,7 @@ /** * This is abstract implementation of SystemManager. * - * @author <a href="mailto:peter at realityforge.org">Peter Donald</a> + * @author Peter Donald */ public abstract class AbstractSystemManager extends AbstractLogEnabled @@ -146,22 +146,22 @@ } /** - * Returns the subcontext of the specified name. If it does not exist it - * is created. + * Returns the subcontext of the specified name. If it does not exist it is + * created. * + * @return the subcontext with the specified name * @throws LoomException if context cannot be created or retrieved - * @return the subcontext with the specified name */ - public SystemManager getSubContext( final String parent, final String type ) + public SystemManager getSubContext( final String parent, + final String type ) throws LoomException { return m_subContext.getSubContext( parent, type ); } /** - * Export the object to the particular management medium using - * the supplied object and interfaces. - * This needs to be implemented by subclasses. + * Export the object to the particular management medium using the supplied + * object and interfaces. This needs to be implemented by subclasses. * * @param name the name of object * @param object the object @@ -182,8 +182,8 @@ throws LoomException; /** - * Helper method to help check before an objects registration. - * Verifies name and object are not null and verifies no entry exists using name. + * Helper method to help check before an objects registration. Verifies name + * and object are not null and verifies no entry exists using name. * * @param name the name of object * @param object the object to be registered @@ -204,7 +204,8 @@ if( null != m_entries.get( name ) ) { - final String message = name + " already registered in SystemManager"; + final String message = name + + " already registered in SystemManager"; throw new LoomException( message ); } } Index: MX4JSystemManager.java =================================================================== RCS file: /cvsroot/jcontainer/jcontainer/loom/engine/src/java/org/jcontainer/loom/components/manager/MX4JSystemManager.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- MX4JSystemManager.java 5 Oct 2003 08:10:20 -0000 1.8 +++ MX4JSystemManager.java 29 Nov 2003 13:44:21 -0000 1.9 @@ -110,7 +110,7 @@ * This component is responsible for managing loom instance. * * @author <a href="[email protected]">Leo Simons</a> - * @author <a href="mailto:peter at realityforge.org">Peter Donald</a> + * @author Peter Donald * @author <a href="mailto:Huw-/[email protected]">Huw Roberts</a> */ public class MX4JSystemManager @@ -154,12 +154,19 @@ getLogger().debug( "MX4J HTTP listener port: " + m_port ); - m_rmi = configuration.getChild( "enable-rmi-adaptor" ).getValueAsBoolean( false ); - m_rmi_registry_port = configuration.getChild( "rmi-registry-port" ).getValueAsInteger( DEFAULT_RMIREGISTRY_PORT ); - m_http = configuration.getChild( "enable-http-adaptor" ).getValueAsBoolean( false ); + m_rmi = + configuration.getChild( "enable-rmi-adaptor" ).getValueAsBoolean( + false ); + m_rmi_registry_port = + configuration.getChild( "rmi-registry-port" ).getValueAsInteger( + DEFAULT_RMIREGISTRY_PORT ); + m_http = + configuration.getChild( "enable-http-adaptor" ).getValueAsBoolean( + false ); m_namingFactory = - configuration.getChild( "rmi-naming-factory" ).getValue( DEFAULT_NAMING_FACTORY ); + configuration.getChild( "rmi-naming-factory" ).getValue( + DEFAULT_NAMING_FACTORY ); final String stylesheets = configuration.getChild( "stylesheets-dir" ).getValue( null ); @@ -216,9 +223,14 @@ throws Exception { final ObjectName adaptorName = new ObjectName( "Http:name=HttpAdaptor" ); - mBeanServer.createMBean( "mx4j.adaptor.http.HttpAdaptor", adaptorName, null ); - mBeanServer.setAttribute( adaptorName, new Attribute( "Host", m_host ) ); - mBeanServer.setAttribute( adaptorName, new Attribute( "Port", new Integer( m_port ) ) ); + mBeanServer.createMBean( "mx4j.adaptor.http.HttpAdaptor", + adaptorName, + null ); + mBeanServer.setAttribute( adaptorName, + new Attribute( "Host", m_host ) ); + mBeanServer.setAttribute( adaptorName, + new Attribute( "Port", + new Integer( m_port ) ) ); if( null != m_username ) { @@ -235,13 +247,19 @@ final ObjectName adaptorName ) throws Exception { - final ObjectName processorName = new ObjectName( "Http:name=XSLTProcessor" ); - mBeanServer.createMBean( "mx4j.adaptor.http.XSLTProcessor", processorName, null ); - mBeanServer.setAttribute( adaptorName, new Attribute( "ProcessorName", processorName ) ); + final ObjectName processorName = new ObjectName( + "Http:name=XSLTProcessor" ); + mBeanServer.createMBean( "mx4j.adaptor.http.XSLTProcessor", + processorName, + null ); + mBeanServer.setAttribute( adaptorName, + new Attribute( "ProcessorName", + processorName ) ); if( null != m_stylesheetDir ) { - final Attribute stylesheetDir = new Attribute( "File", m_stylesheetDir ); + final Attribute stylesheetDir = new Attribute( "File", + m_stylesheetDir ); mBeanServer.setAttribute( processorName, stylesheetDir ); } @@ -250,17 +268,25 @@ mBeanServer.setAttribute( processorName, useCache ); } - private void configureAuthentication( final MBeanServer mBeanServer, final ObjectName adaptorName ) throws InstanceNotFoundException, MBeanException, ReflectionException, AttributeNotFoundException, InvalidAttributeValueException + private void configureAuthentication( final MBeanServer mBeanServer, + final ObjectName adaptorName ) + throws InstanceNotFoundException, + MBeanException, + ReflectionException, + AttributeNotFoundException, + InvalidAttributeValueException { // add user names mBeanServer.invoke( adaptorName, "addAuthorization", new Object[]{m_username, m_password}, - new String[]{"java.lang.String", "java.lang.String"} ); + new String[]{"java.lang.String", + "java.lang.String"} ); // use basic authentication mBeanServer.setAttribute( adaptorName, - new Attribute( "AuthenticationMethod", "basic" ) ); + new Attribute( "AuthenticationMethod", + "basic" ) ); } private void stopHttpAdaptor( final MBeanServer server ) @@ -283,16 +309,19 @@ // Create the JRMP adaptor final ObjectName adaptor = new ObjectName( "Adaptor:protocol=JRMP" ); - server.createMBean( "mx4j.adaptor.rmi.jrmp.JRMPAdaptor", adaptor, null ); + server.createMBean( "mx4j.adaptor.rmi.jrmp.JRMPAdaptor", + adaptor, + null ); final JRMPAdaptorMBean mbean = - (JRMPAdaptorMBean)StandardMBeanProxy.create( JRMPAdaptorMBean.class, - server, - adaptor ); + (JRMPAdaptorMBean)StandardMBeanProxy.create( + JRMPAdaptorMBean.class, + server, + adaptor ); // Set the JNDI name with which will be registered mbean.setJNDIName( "jrmp" ); mbean.putNamingProperty( javax.naming.Context.INITIAL_CONTEXT_FACTORY, - m_namingFactory ); + m_namingFactory ); mbean.putNamingProperty( javax.naming.Context.PROVIDER_URL, "rmi://localhost:" + m_rmi_registry_port ); @@ -313,10 +342,12 @@ { MX4JLoggerAdapter.setLogger( getLogger() ); Log.redirectTo( new MX4JLoggerAdapter() ); - return MBeanServerFactory.createMBeanServer( ContainerConstants.SOFTWARE ); + return MBeanServerFactory.createMBeanServer( + ContainerConstants.SOFTWARE ); } - private void stopJMXMBean( final MBeanServer mBeanServer, final String name ) + private void stopJMXMBean( final MBeanServer mBeanServer, + final String name ) { try {