Mail Archive Home | fractal-commits List | Febuary 2006 Index
| <-- Date Index --> | <-- Thread Index --> |
Date: Friday, February 24, 2006 @ 18:59:44
Author: merle
Path: /cvsroot/fractal/fractalexplorer
Added: src/org/objectweb/fractal/explorer/rmi/StubInfo.java
Modified: resources/config/RMIProperties.xml
Display in the Fractal Explorer Information Bar
the network location of Fractal RMI stubs.
------------------------------------------------------+
resources/config/RMIProperties.xml | 80 ++++++++------
src/org/objectweb/fractal/explorer/rmi/StubInfo.java | 97 +++++++++++++++++
2 files changed, 143 insertions(+), 34 deletions(-)
Index: fractalexplorer/resources/config/RMIProperties.xml
diff -u fractalexplorer/resources/config/RMIProperties.xml:1.1
fractalexplorer/resources/config/RMIProperties.xml:1.2
--- fractalexplorer/resources/config/RMIProperties.xml:1.1 Thu Jul 21
17:47:00 2005
+++ fractalexplorer/resources/config/RMIProperties.xml Fri Feb 24 18:59:44
2006
@@ -2,41 +2,53 @@
<explorer>
- <!-- =================================================================
-->
- <!-- RMI
-->
- <!-- =================================================================
-->
+ <!-- ================================================================= -->
+ <!-- Fractal RMI Stub -->
+ <!-- ================================================================= -->
+
+ <node type-name="org.objectweb.fractal.rmi.stub.Stub">
+ <info><code>org.objectweb.fractal.explorer.rmi.StubInfo</code></info>
+ </node>
+
+ <!-- ================================================================= -->
+ <!-- Fractal RMI Registry -->
+ <!-- ================================================================= -->
-
<root><code>org.objectweb.fractal.explorer.rmi.FractalRegistriesRootContext</code></root>
+ <root>
+
<code>org.objectweb.fractal.explorer.rmi.FractalRegistriesRootContext</code>
+ </root>
- <node
type-name="org.objectweb.fractal.explorer.rmi.FractalRegistriesContext">
- <menu>
- <item label="Connect to a registry">
-
<code>org.objectweb.fractal.explorer.rmi.ConnectToRegistryAction</code>
- <icon><icon-file url="icons/connectNS.png"/></icon>
- </item>
- <item label="Disconnect this registry" tree-child-visible="true">
-
<code>org.objectweb.fractal.explorer.rmi.DisconnectRegistryAction</code>
- <icon><icon-file url="icons/disconnectNS.png"/></icon>
- </item>
- </menu>
- </node>
+ <node
type-name="org.objectweb.fractal.explorer.rmi.FractalRegistriesContext">
+ <menu>
+ <item label="Connect to a registry">
+
<code>org.objectweb.fractal.explorer.rmi.ConnectToRegistryAction</code>
+ <icon><icon-file url="icons/connectNS.png"/></icon>
+ </item>
+ <item label="Disconnect this registry" tree-child-visible="true">
+
<code>org.objectweb.fractal.explorer.rmi.DisconnectRegistryAction</code>
+ <icon><icon-file url="icons/disconnectNS.png"/></icon>
+ </item>
+ </menu>
+ </node>
- <node type-name="org.objectweb.fractal.rmi.registry.NamingService">
-
<wrapper><code>org.objectweb.fractal.explorer.rmi.NamingServiceContext</code></wrapper>
- <icon><icon-file url="icons/NamingService.png" /></icon>
- <menu>
- <item label="Bind a component">
- <code>org.objectweb.fractal.explorer.rmi.BindComponentAction</code>
- <icon><icon-file url="icons/bind.png"/></icon>
- </item>
- <item label="Unbind from this registry" tree-child-visible="true">
-
<code>org.objectweb.fractal.explorer.rmi.UnbindComponentAction</code>
- <icon><icon-file url="icons/unbind.png"/></icon>
- </item>
- </menu>
- <drop-action label="Bind a component">
-
<code>org.objectweb.fractal.explorer.rmi.BindComponentOnDropAction</code>
- </drop-action>
- </node>
+ <node type-name="org.objectweb.fractal.rmi.registry.NamingService">
+ <wrapper>
+ <code>org.objectweb.fractal.explorer.rmi.NamingServiceContext</code>
+ </wrapper>
+ <icon><icon-file url="icons/NamingService.png" /></icon>
+ <menu>
+ <item label="Bind a component">
+ <code>org.objectweb.fractal.explorer.rmi.BindComponentAction</code>
+ <icon><icon-file url="icons/bind.png"/></icon>
+ </item>
+ <item label="Unbind from this registry" tree-child-visible="true">
+ <code>org.objectweb.fractal.explorer.rmi.UnbindComponentAction</code>
+ <icon><icon-file url="icons/unbind.png"/></icon>
+ </item>
+ </menu>
+ <drop-action label="Bind a component">
+
<code>org.objectweb.fractal.explorer.rmi.BindComponentOnDropAction</code>
+ </drop-action>
+ </node>
-</explorer>
\ No newline at end of file
+</explorer>
Index: fractalexplorer/src/org/objectweb/fractal/explorer/rmi/StubInfo.java
diff -u /dev/null
fractalexplorer/src/org/objectweb/fractal/explorer/rmi/StubInfo.java:1.1
--- /dev/null Fri Feb 24 18:59:44 2006
+++ fractalexplorer/src/org/objectweb/fractal/explorer/rmi/StubInfo.java
Fri Feb 24 18:59:44 2006
@@ -0,0 +1,97 @@
+/*====================================================================
+
+ObjectWeb Fractal Explorer
+Copyright (C) 2005-2006 INRIA
+Contact: fractal@xxxxxxxxxxxxx
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+USA
+
+Initial developer(s): Philippe Merle.
+Contributor(s): ______________________________________.
+
+====================================================================
+$Id: StubInfo.java,v 1.1 2006/02/24 17:59:44 merle Exp $
+====================================================================*/
+
+package org.objectweb.fractal.explorer.rmi;
+
+import org.objectweb.fractal.explorer.info.InterfaceInfo;
+
+import org.objectweb.fractal.rmi.stub.Stub;
+
+import org.objectweb.util.explorer.api.TreeView;
+
+/**
+ * Computes the signature of the interface + the localisation of the remote
interface.
+ *
+ * @author <a href="mailto:Philippe.Merle@xxxxxxxx">Philippe Merle</a>
+ * @version $Revision: 1.1 $
+ */
+
+public class StubInfo
+ extends InterfaceInfo
+{
+ // ==================================================================
+ //
+ // Public methods for interface org.objectweb.util.explorer.api.Info
+ //
+ // ==================================================================
+
+ /**
+ * @see
org.objectweb.util.explorer.api.Info#getInfo(org.objectweb.util.explorer.api.TreeView)
+ */
+ public String
+ getInfo(final TreeView treeView)
+ {
+ StringBuffer result = new StringBuffer();
+
+ // Append the InterfaceInfo.getInfo() firstly.
+ result.append(super.getInfo(treeView));
+
+ // Obtain the selected stub.
+ Stub stub = (Stub)treeView.getSelectedObject();
+
+ // Obtain its textual description, i.e. Id[host,port,Id[oid]]
+ String info = stub.getIdentifiers()[0].toString();
+
+ // Determine the host.
+ int startIndex = 3;
+ int endIndex = info.indexOf(',', startIndex);
+
+ // Append the host to the result.
+ result.append(" [host=");
+ result.append(info.substring(startIndex, endIndex));
+
+ // Determine the port.
+ startIndex = endIndex+1;
+ endIndex = info.indexOf(',', startIndex);
+
+ // Append the port to the result.
+ result.append(",port=");
+ result.append(info.substring(startIndex, endIndex));
+
+ // Determine the oid.
+ startIndex = endIndex+4;
+ endIndex = info.length()-2;
+
+ // Append the oid to the result.
+ result.append(",oid=");
+ result.append(info.substring(startIndex, endIndex));
+
+ result.append(']');
+ return result.toString();
+ }
+}
| <-- Date Index --> | <-- Thread Index --> |
Powered by MHonArc.
Copyright © 2006-2007, OW2 Consortium | contact | webmaster.