User: patriot1burke
Date: 01/09/18 14:21:08
Modified: src/main/org/jboss/ha/jndi HANamingService.java
Log:
work in progress
Revision Changes Path
1.2 +21 -16 jbossmx/src/main/org/jboss/ha/jndi/HANamingService.java
Index: HANamingService.java
===================================================================
RCS file: /cvsroot/jboss/jbossmx/src/main/org/jboss/ha/jndi/HANamingService.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- HANamingService.java 2001/09/14 03:54:25 1.1
+++ HANamingService.java 2001/09/18 21:21:08 1.2
@@ -58,7 +58,7 @@
@author oberg
@author [EMAIL PROTECTED]
- @version $Revision: 1.1 $
+ @version $Revision: 1.2 $
*/
public class HANamingService extends ServiceMBeanSupport implements Runnable,
HANamingServiceMBean, DistributedReplicantManager.ReplicantListener
{
@@ -89,7 +89,7 @@
/** The RMI port on which the Naming implementation will be exported. The
default is 0 which means use any available port. */
protected int rmiPort = 0;
- protected Category log;
+ protected Logger log;
protected HARMITarget hatarget;
protected Naming hastub;
@@ -99,6 +99,11 @@
protected String partitionName = "DefaultPartition";
// Public --------------------------------------------------------
+
+ public HANamingService()
+ {
+ log = Logger.create("HANamingService");
+ }
public String getName()
{
@@ -208,40 +213,39 @@
public void initService() throws Exception
{
- partition = (HAPartition)new InitialContext().lookup("/HAPartition/" +
partitionName);
- replicantManager = partition.getDistributedReplicantManager();
}
public void startService()
throws Exception
{
log.info("Starting HA-JNDI server");
-
- // Create remote object
+ partition = (HAPartition)new InitialContext().lookup("/HAPartition/" +
partitionName);
+ replicantManager = partition.getDistributedReplicantManager();
+ log.info("Create remote object");
theServer = new HAJNDI(partition);
((HAJNDI)theServer).init();
- // Export RMI server
- stub = (RemoteStub)UnicastRemoteObject.exportObject(theServer, rmiPort,
clientSocketFactory, serverSocketFactory);
+ log.info("Export RMI server");
+ stub = UnicastRemoteObject.exportObject(theServer);
- // Bind replicant to DistributedReplicantManager
+ log.info("Bind replicant to DistributedReplicantManager");
replicantManager.add("HA-JNDI", stub);
- // Get all replicants for DistributedReplicantManager and HA-JNDI
+ log.info("Get all replicants for DistributedReplicantManager and HA-JNDI");
ArrayList managers =
this.replicantManager.lookupReplicants("DistributedReplicantManager");
ArrayList replicants = this.replicantManager.lookupReplicants("HA-JNDI");
- // Create HA-JNDI RMI Proxy
+ log.info("Create HA-JNDI RMI Proxy with " + replicants.size() + "
replicants");
this.hatarget = new HARMITarget("HA-JNDI", 100000, 500000, managers,
replicants.toArray(), new RoundRobin());
this.hastub = (Naming)Proxy.newProxyInstance(
Naming.class.getClassLoader(),
new Class[] { Naming.class },
this.hatarget);
- // Register with replicantManager as listener for HA-JNDI replicants
+ log.info("Register with replicantManager as listener for HA-JNDI replicants");
replicantManager.registerListener("HA-JNDI", this);
- // Start listener
+ log.info("Start listener");
try
{
serverSocket = null;
@@ -249,9 +253,10 @@
// If an anonymous port was specified get the actual port used
if( port == 0 )
port = serverSocket.getLocalPort();
- String msg = "Started hajndiPort=" + port +", rmiPort=" + rmiPort
- + ", backlog="+backlog+", bindAddress="+bindAddress
- + ", Client SocketFactory="+clientSocketFactory+", Server
SocketFactory="+serverSocketFactory;
+ String msg = "Started hajndiPort=" + port;
+ /* +", rmiPort=" + rmiPort
+ + ", backlog="+backlog+", bindAddress="+bindAddress
+ + ", Client SocketFactory="+clientSocketFactory+", Server
SocketFactory="+serverSocketFactory;*/
log.info(msg);
listen();
} catch (IOException e)
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development