From portal-commits at lists.jboss.org Wed Jan 31 20:31:22 2007 Content-Type: multipart/mixed; boundary="===============3978291816625585979==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r6136 - in trunk/test/src: main/org/jboss/portal/test/framework/server and 1 other directories. Date: Wed, 31 Jan 2007 20:31:22 -0500 Message-ID: --===============3978291816625585979== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2007-01-31 20:31:21 -0500 (Wed, 31 Jan 2007) New Revision: 6136 Modified: trunk/test/src/main/org/jboss/portal/test/framework/JBossServiceLookup.j= ava trunk/test/src/main/org/jboss/portal/test/framework/JNDIServiceLookup.ja= va trunk/test/src/main/org/jboss/portal/test/framework/server/Node.java trunk/test/src/main/org/jboss/portal/test/framework/server/NodeId.java trunk/test/src/main/org/jboss/portal/test/framework/server/NodeManager.j= ava trunk/test/src/resources/portal-test-jar/org/jboss/portal/test/framework= /container/jboss-beans.xml Log: improves slightly NodeManager/Node bean wiring (which was working but not c= orrect, had to find a workaround before I discovered that kind of wiring wa= s possible to be done) Modified: trunk/test/src/main/org/jboss/portal/test/framework/JBossServiceL= ookup.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/test/src/main/org/jboss/portal/test/framework/JBossServiceLookup.= java 2007-02-01 00:06:56 UTC (rev 6135) +++ trunk/test/src/main/org/jboss/portal/test/framework/JBossServiceLookup.= java 2007-02-01 01:31:21 UTC (rev 6136) @@ -54,7 +54,7 @@ { Class proxyClass =3D Thread.currentThread().getContextClassLoader= ().loadClass(proxyClassName); ObjectName name =3D new ObjectName(this.name); - MBeanServer server =3D node.getServer(); + MBeanServer server =3D node.getMBeanServer(); return MBeanProxy.get(proxyClass, name, server); } catch (Exception e) Modified: trunk/test/src/main/org/jboss/portal/test/framework/JNDIServiceLo= okup.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/test/src/main/org/jboss/portal/test/framework/JNDIServiceLookup.j= ava 2007-02-01 00:06:56 UTC (rev 6135) +++ trunk/test/src/main/org/jboss/portal/test/framework/JNDIServiceLookup.j= ava 2007-02-01 01:31:21 UTC (rev 6136) @@ -25,8 +25,8 @@ = import org.jboss.portal.test.framework.server.Node; = -import javax.naming.InitialContext; import javax.naming.NamingException; +import javax.naming.Context; = /** * @author Julien Viet @@ -56,10 +56,10 @@ = public Object getService(Node node) { - InitialContext ctx =3D null; + Context ctx =3D null; try { - ctx =3D node.getInitialContext(); + ctx =3D node.getNamingContext(); return ctx.lookup(jndiName); } catch (NamingException e) Modified: trunk/test/src/main/org/jboss/portal/test/framework/server/Node.j= ava =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/test/src/main/org/jboss/portal/test/framework/server/Node.java 20= 07-02-01 00:06:56 UTC (rev 6135) +++ trunk/test/src/main/org/jboss/portal/test/framework/server/Node.java 20= 07-02-01 01:31:21 UTC (rev 6136) @@ -26,6 +26,7 @@ import javax.management.MBeanServer; import javax.naming.InitialContext; import javax.naming.NamingException; +import javax.naming.Context; import java.util.Properties; = /** @@ -35,36 +36,49 @@ public class Node { = + /** . */ private final NodeId id; = - private MBeanServer server; + /** . */ + private final MBeanServer mbeanServer; = - private NodeManager nodeManager; + /** . */ + private final Properties jndiEnv; = - private Properties jndiEnv; - - public Node(String id, MBeanServer server, NodeManager nodeManager, Pro= perties jndiEnv) + public Node(String id, MBeanServer mBeanServer, Properties jndiEnv) { this.id =3D new NodeId(id); - this.server =3D server; - this.nodeManager =3D nodeManager; + this.mbeanServer =3D mBeanServer; this.jndiEnv =3D jndiEnv; - - // - nodeManager.nodeMap.put(this.id, this); } = + /** + * Returns the node id. + * + * @return the node id + */ public NodeId getId() { return id; } = - public MBeanServer getServer() + /** + * Returns the MBeanServer of the node. + * + * @return the mbean server + */ + public MBeanServer getMBeanServer() { - return server; + return mbeanServer; } = - public InitialContext getInitialContext() throws NamingException + /** + * Returns the naming context that resolves to the node. + * + * @return the naming context + * @throws NamingException + */ + public Context getNamingContext() throws NamingException { return new InitialContext(jndiEnv); } Modified: trunk/test/src/main/org/jboss/portal/test/framework/server/NodeId= .java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/test/src/main/org/jboss/portal/test/framework/server/NodeId.java = 2007-02-01 00:06:56 UTC (rev 6135) +++ trunk/test/src/main/org/jboss/portal/test/framework/server/NodeId.java = 2007-02-01 01:31:21 UTC (rev 6136) @@ -41,6 +41,7 @@ /** . */ public static final NodeId PORTS_02 =3D new NodeId("ports-02"); = + /** . */ private final String value; = public NodeId(String value) @@ -63,19 +64,12 @@ { return true; } - if (o =3D=3D null || getClass() !=3D o.getClass()) + if (o instanceof NodeId) { - return false; + NodeId that =3D (NodeId)o; + return value.equals(that.value); } - - final NodeId nodeId =3D (NodeId)o; - - if (!value.equals(nodeId.value)) - { - return false; - } - - return true; + return false; } = public int hashCode() Modified: trunk/test/src/main/org/jboss/portal/test/framework/server/NodeMa= nager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/test/src/main/org/jboss/portal/test/framework/server/NodeManager.= java 2007-02-01 00:06:56 UTC (rev 6135) +++ trunk/test/src/main/org/jboss/portal/test/framework/server/NodeManager.= java 2007-02-01 01:31:21 UTC (rev 6136) @@ -26,6 +26,8 @@ import java.util.Collection; import java.util.HashMap; import java.util.Map; +import java.util.List; +import java.util.Iterator; = /** * @author Julien Viet @@ -34,16 +36,17 @@ public class NodeManager { = - Map nodeMap; + /** The nodes. */ + private final Map nodeMap; = - public NodeManager() + public NodeManager(List nodes) { - nodeMap =3D new HashMap(); -// for (Iterator i =3D nodes.iterator(); i.hasNext();) -// { -// Node node =3D (Node)i.next(); -// nodeMap.put(node.getId(), node); -// } + this.nodeMap =3D new HashMap(); + for (Iterator i =3D nodes.iterator();i.hasNext();) + { + Node node =3D (Node)i.next(); + nodeMap.put(node.getId(), node); + } } = public Collection getNodes() Modified: trunk/test/src/resources/portal-test-jar/org/jboss/portal/test/fr= amework/container/jboss-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/test/src/resources/portal-test-jar/org/jboss/portal/test/framewor= k/container/jboss-beans.xml 2007-02-01 00:06:56 UTC (rev 6135) +++ trunk/test/src/resources/portal-test-jar/org/jboss/portal/test/framewor= k/container/jboss-beans.xml 2007-02-01 01:31:21 UTC (rev 6136) @@ -88,7 +88,6 @@ default - @@ -112,7 +111,6 @@ ports-01 - @@ -136,7 +134,6 @@ ports-02 - @@ -169,6 +166,15 @@ = + + + + + + + + + = --===============3978291816625585979==--