Author: ron.sigal(a)jboss.com
Date: 2008-06-19 21:35:20 -0400 (Thu, 19 Jun 2008)
New Revision: 4300
Modified:
remoting2/branches/2.2/src/main/org/jboss/remoting/transport/Connector.java
Log:
JBREM-962: Added ability to read <repositories> element from xml config file.
Modified: remoting2/branches/2.2/src/main/org/jboss/remoting/transport/Connector.java
===================================================================
--- remoting2/branches/2.2/src/main/org/jboss/remoting/transport/Connector.java 2008-06-20
01:33:33 UTC (rev 4299)
+++ remoting2/branches/2.2/src/main/org/jboss/remoting/transport/Connector.java 2008-06-20
01:35:20 UTC (rev 4300)
@@ -44,8 +44,10 @@
import javax.net.ServerSocketFactory;
import javax.net.SocketFactory;
import java.net.InetAddress;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;
@@ -463,7 +465,8 @@
// if loaderLocator is null, then probably not defined to have loader service (i.e.
no loader port specified)
if (loaderLocator != null)
{
- marshallerLoader = MarshallLoaderFactory.createMarshallLoader(loaderLocator);
+ List repositories = getLoaderRepositories();
+ marshallerLoader = MarshallLoaderFactory.createMarshallLoader(loaderLocator,
repositories, server);
}
return marshallerLoader;
}
@@ -628,6 +631,41 @@
}
}
+ private List getLoaderRepositories()
+ {
+ if (xml == null)
+ {
+ return null;
+ }
+
+ NodeList repositoryNodes = xml.getElementsByTagName("repository");
+ if (repositoryNodes.getLength() == 0)
+ {
+ return null;
+ }
+
+ List repositories = new ArrayList();
+ for (int i = 0; i < repositoryNodes.getLength(); i++)
+ {
+ Node node = repositoryNodes.item(i);
+ String repositoryName = node.getFirstChild().getNodeValue();
+
+ try
+ {
+ ObjectName objName = new ObjectName(repositoryName);
+ repositories.add(objName);
+ log.info("repository: " + repositoryName);
+ }
+ catch (MalformedObjectNameException e)
+ {
+ log.debug("repository name is not an object name: " +
repositoryName);
+ continue;
+ }
+ }
+
+ return repositories;
+ }
+
private ServerInvocationHandler createHandlerProxy(ObjectName objName)
{
ServerInvocationHandler handler;
Show replies by date