User: patriot1burke
Date: 01/09/15 08:53:57
Modified: src/main/org/jboss/ha HAPartitionImpl.java
DistributedReplicantManagerImpl.java
DistributedReplicantManager.java
ClusterPartition.java
Log:
still a work in progress, but I'm progressing...Still doesn't work yet!!!
Revision Changes Path
1.2 +29 -9 jbossmx/src/main/org/jboss/ha/HAPartitionImpl.java
Index: HAPartitionImpl.java
===================================================================
RCS file: /cvsroot/jboss/jbossmx/src/main/org/jboss/ha/HAPartitionImpl.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- HAPartitionImpl.java 2001/09/14 03:53:29 1.1
+++ HAPartitionImpl.java 2001/09/15 15:53:57 1.2
@@ -44,19 +44,27 @@
public HAPartitionImpl(String partitionName, JChannel channel,
boolean deadlock_detection) throws Exception
{
- super(channel, null, null, null, deadlock_detection);
+ super(channel, null, null, new Object(), false);
+ System.out.println("called super");
this.channel = channel;
this.partitionName = partitionName;
- this.nodeName = channel.GetLocalAddress().toString();
}
public void init() throws Exception
{
+ System.out.println("SetMembershipListener");
SetMembershipListener(this);
+ System.out.println("SetMessageListener");
SetMessageListener(this);
+ System.out.println("get nodeName");
+ this.nodeName = channel.GetLocalAddress().toString();
+ System.out.println("create replicant manager");
this.replicantManager = new DistributedReplicantManagerImpl(this);
+ System.out.println("init replicant manager");
this.replicantManager.init();
+ System.out.println("bind replicant manager");
new InitialContext().bind("/HAPartition/" + partitionName, this);
+ System.out.println("done initing..");
}
public void close() throws Exception
@@ -159,14 +167,26 @@
public void SetState(Object obj)
{
- HashMap state = (HashMap)obj;
- Iterator keys = state.keySet().iterator();
- while (keys.hasNext())
+ try
{
- String key = (String)keys.next();
- Object someState = state.get(key);
- HAPartition.HAPartitionStateTransfer subscriber =
(HAPartition.HAPartitionStateTransfer)stateHandlers.get(key);
- subscriber.setCurrentState((Serializable)someState);
+ if (obj == null)
+ {
+ System.out.println("state is null");
+ return;
+ }
+ HashMap state = (HashMap)obj;
+ Iterator keys = state.keySet().iterator();
+ while (keys.hasNext())
+ {
+ String key = (String)keys.next();
+ Object someState = state.get(key);
+ HAPartition.HAPartitionStateTransfer subscriber =
(HAPartition.HAPartitionStateTransfer)stateHandlers.get(key);
+ subscriber.setCurrentState((Serializable)someState);
+ }
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
}
}
1.2 +4 -4
jbossmx/src/main/org/jboss/ha/DistributedReplicantManagerImpl.java
Index: DistributedReplicantManagerImpl.java
===================================================================
RCS file:
/cvsroot/jboss/jbossmx/src/main/org/jboss/ha/DistributedReplicantManagerImpl.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DistributedReplicantManagerImpl.java 2001/09/14 03:53:29 1.1
+++ DistributedReplicantManagerImpl.java 2001/09/15 15:53:57 1.2
@@ -142,7 +142,7 @@
}
- public Serializable lookupLocalReplicant(String key)
+ public Serializable lookupLocalReplicant(String key) throws Exception
{
synchronized(this.replicants)
{
@@ -153,7 +153,7 @@
}
}
- public ArrayList lookupReplicants(String key)
+ public ArrayList lookupReplicants(String key) throws Exception
{
synchronized(this.replicants)
{
@@ -165,7 +165,7 @@
}
- public void registerListener(String key,
DistributedReplicantManager.ReplicantListener subscriber)
+ public void registerListener(String key,
DistributedReplicantManager.ReplicantListener subscriber) throws Exception
{
synchronized(this.keyListeners)
{
@@ -179,7 +179,7 @@
}
}
- public void unregisterListener(String key,
DistributedReplicantManager.ReplicantListener subscriber)
+ public void unregisterListener(String key,
DistributedReplicantManager.ReplicantListener subscriber) throws Exception
{
synchronized(this.keyListeners)
{
1.2 +6 -5 jbossmx/src/main/org/jboss/ha/DistributedReplicantManager.java
Index: DistributedReplicantManager.java
===================================================================
RCS file:
/cvsroot/jboss/jbossmx/src/main/org/jboss/ha/DistributedReplicantManager.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DistributedReplicantManager.java 2001/09/14 03:53:29 1.1
+++ DistributedReplicantManager.java 2001/09/15 15:53:57 1.2
@@ -4,6 +4,7 @@
import java.io.Serializable;
import java.rmi.Remote;
+import java.rmi.RemoteException;
public interface DistributedReplicantManager extends Remote
{
@@ -16,15 +17,15 @@
public void replicantsChanged(String key, ArrayList newReplicants);
}
- public void registerListener(String key, ReplicantListener subscriber);
- public void unregisterListener(String key, ReplicantListener subscriber);
+ public void registerListener(String key, ReplicantListener subscriber) throws
Exception;
+ public void unregisterListener(String key, ReplicantListener subscriber) throws
Exception;
// State binding methods
//
/**
* remove the entire key from the ReplicationService
*/
- public void remove(String key) throws Exception;
+ public void remove(String key) throws Exception;;
/**
* Add a replicant, it will be attached to this cluster node
@@ -34,11 +35,11 @@
/**
* Lookup the replicant attached to this cluster node
*/
- public Serializable lookupLocalReplicant(String key);
+ public Serializable lookupLocalReplicant(String key) throws Exception;
/**
* Return a list of all replicants.
*/
- public ArrayList lookupReplicants(String key);
+ public ArrayList lookupReplicants(String key) throws Exception;
}
1.2 +8 -3 jbossmx/src/main/org/jboss/ha/ClusterPartition.java
Index: ClusterPartition.java
===================================================================
RCS file: /cvsroot/jboss/jbossmx/src/main/org/jboss/ha/ClusterPartition.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ClusterPartition.java 2001/09/14 03:53:29 1.1
+++ ClusterPartition.java 2001/09/15 15:53:57 1.2
@@ -16,8 +16,8 @@
{
protected String partitionName = "DefaultPartition";
protected String jgProps =
- "UDP(mcast_addr=224.100.100.200;mcast_port=4567;ip_ttl=31;trace=true):" +
- "PING(timeout=3000;num_initial_members=10):" +
+ "UDP:" +
+ "PING:" +
"FD(trace=true;timeout=5000):" +
"VERIFY_SUSPECT(trace=false;timeout=1500):" +
"pbcast.NAKACK(trace=true):" +
@@ -77,9 +77,13 @@
JChannel channel = new JChannel(jgProps);
channel.SetOpt(Channel.LOCAL, new Boolean(false));
channel.SetOpt(Channel.GET_STATE_EVENTS, new Boolean(true));
- channel.Connect(partitionName);
+ log.info("Creating Partition");
partition = new HAPartitionImpl(partitionName, channel, deadlock_detection);
+ log.info("Connecting to channel");
+ channel.Connect(partitionName);
+ log.info("Initing Partition");
partition.init();
+ log.info("Started ClusterPartition: " + partitionName);
}
public void stopService()
{
@@ -87,6 +91,7 @@
{
log.info("Stopping ClusterPartition: " + partitionName);
partition.close();
+ log.info("Stopped ClusterPartition: " + partitionName);
}
catch (Exception e)
{
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development