donaldp 2002/09/20 17:52:11
Modified: src/conf kernel.xml
src/java/org/apache/avalon/phoenix/components/manager
MX4JSystemManager.java
Log:
Here's a patch to allow for the setting of the Host attribute on the MX4J
HttpAdaptor. This adds an optional 'manager-adapter-host' attribute that
can be configured in the MX4JSystemManager section of kernel.xml.
The reason for this patch is that the HttpAdaptor only binds to localhost by
default, thus leaving it inaccessible to remote machines. The default
behaviour of this patch is to still bind to localhost, as before, but one
can now optionally specify a host alias for a public interface.
Submitted by: "Marc Tremblay" <[EMAIL PROTECTED]>
Revision Changes Path
1.23 +3 -0 jakarta-avalon-phoenix/src/conf/kernel.xml
Index: kernel.xml
===================================================================
RCS file: /home/cvs/jakarta-avalon-phoenix/src/conf/kernel.xml,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- kernel.xml 13 Sep 2002 10:26:12 -0000 1.22
+++ kernel.xml 21 Sep 2002 00:52:11 -0000 1.23
@@ -33,6 +33,9 @@
<component role="org.apache.avalon.phoenix.interfaces.SystemManager"
class="org.apache.avalon.phoenix.components.manager.MX4JSystemManager"
logger="manager" >
+ <!--
+ <manager-adaptor-host>localhost</manager-adaptor-host>
+ -->
<manager-adaptor-port>8082</manager-adaptor-port>
<!--
<enable-rmi-adaptor>true</enable-rmi-adaptor>
1.20 +6 -0
jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/manager/MX4JSystemManager.java
Index: MX4JSystemManager.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/manager/MX4JSystemManager.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- MX4JSystemManager.java 6 Sep 2002 12:43:55 -0000 1.19
+++ MX4JSystemManager.java 21 Sep 2002 00:52:11 -0000 1.20
@@ -40,9 +40,11 @@
{
private static final String DEFAULT_NAMING_FACTORY =
"com.sun.jndi.rmi.registry.RegistryContextFactory";
+ private static final String DEFAULT_HTTPADAPTER_HOST = "localhost";
private static final int DEFAULT_HTTPADAPTER_PORT =
Integer.getInteger( "phoenix.adapter.http", 8082 ).intValue();
+ private String m_host;
private int m_port;
private boolean m_rmi;
private File m_homeDir;
@@ -60,6 +62,9 @@
public void configure( final Configuration configuration )
throws ConfigurationException
{
+ m_host = configuration.getChild( "manager-adaptor-host" ).
+ getValue( DEFAULT_HTTPADAPTER_HOST );
+
m_port = configuration.getChild( "manager-adaptor-port" ).
getValueAsInteger( DEFAULT_HTTPADAPTER_PORT );
@@ -111,6 +116,7 @@
{
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 ) ) );
if( null != m_username )
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>