User: chirino
Date: 01/05/21 21:54:36
Modified: src/main/org/jbossmq/distributed/server
DistributedJMSServerRMIImpl.java
DistributedJMSServerUIL.java
Log:
Revision Changes Path
1.4 +7 -5
jbossmq/src/main/org/jbossmq/distributed/server/DistributedJMSServerRMIImpl.java
Index: DistributedJMSServerRMIImpl.java
===================================================================
RCS file:
/cvsroot/jboss/jbossmq/src/main/org/jbossmq/distributed/server/DistributedJMSServerRMIImpl.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DistributedJMSServerRMIImpl.java 2001/03/02 01:12:54 1.3
+++ DistributedJMSServerRMIImpl.java 2001/05/22 04:54:36 1.4
@@ -42,7 +42,7 @@
* @author Norbert Lataille ([EMAIL PROTECTED])
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public class DistributedJMSServerRMIImpl extends
java.rmi.server.UnicastRemoteObject implements
org.jbossmq.distributed.interfaces.DistributedJMSServerSetup, DistributedJMSServerRMI,
DistributedJMSServerRMIImplMBean {
// Attributes ----------------------------------------------------
@@ -95,10 +95,7 @@
return this;
}
- public void setServer(JMSServer s)
- {
- server=s;
- }
+
public void setSpyDistributedConnection(SpyDistributedConnection
newSpyDistributedConnection) {
// We cannot try to cache the dc since different dc's are going
@@ -162,5 +159,10 @@
public DistributedJMSServer internalClone() {
return this;
+ }
+
+ public void init(JMSServer s, org.jbossmq.xml.XElement config)
+ {
+ server=s;
}
}
1.4 +45 -18
jbossmq/src/main/org/jbossmq/distributed/server/DistributedJMSServerUIL.java
Index: DistributedJMSServerUIL.java
===================================================================
RCS file:
/cvsroot/jboss/jbossmq/src/main/org/jbossmq/distributed/server/DistributedJMSServerUIL.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DistributedJMSServerUIL.java 2001/05/22 03:17:03 1.3
+++ DistributedJMSServerUIL.java 2001/05/22 04:54:36 1.4
@@ -13,6 +13,18 @@
import javax.jms.TemporaryTopic;
import javax.jms.TemporaryQueue;
+
+
+
+
+
+
+
+
+
+
+
+
import java.rmi.RemoteException;
import java.net.ServerSocket;
import java.net.Socket;
@@ -35,17 +47,21 @@
import org.jbossmq.SpyDestination;
import org.jbossmq.distributed.interfaces.DistributedJMSServer;
+import org.jbossmq.xml.XElement;
+
/**
* The UIL implementation of the DistributedJMSServer object
*
* @author Norbert Lataille ([EMAIL PROTECTED])
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public class DistributedJMSServerUIL
implements Runnable, DistributedJMSServerSetup, DistributedJMSServerUILMBean
{
+ //org.apache.log4j.Category cat =
org.apache.log4j.Category.getInstance(DistributedJMSServerUIL.class);
+
static final int m_acknowledge = 1;
static final int m_addMessage = 2;
static final int m_browse = 3;
@@ -71,21 +87,16 @@
protected ServerSocket serverSocket;
- // Constructor ---------------------------------------------------
-
- public DistributedJMSServerUIL()
- {
- exportObject();
- }
- void exportObject()
- {
- try {
- serverSocket = new ServerSocket(0);
- new Thread(this).start();
- } catch (IOException e) {
- failure("Initialization",e);
- }
+
+ void exportObject() {
+ try {
+ serverSocket = new ServerSocket(serverBindPort);
+ Log.notice("JBossMQ listening on PORT: " +
serverSocket.getLocalPort());
+ new Thread(this).start();
+ } catch (IOException e) {
+ failure("Initialization", e);
+ }
}
public void run()
@@ -157,7 +168,7 @@
server.connectionClosing(spyDistributedConnection);
closed = true;
break;
- case m_createQueue:
+ case this.m_createQueue:
result=(Queue)server.createQueue(spyDistributedConnection, (String)in.readObject());
break;
case m_createTopic:
@@ -166,7 +177,7 @@
case m_deleteTemporaryDestination:
server.deleteTemporaryDestination(spyDistributedConnection,
(SpyDestination)in.readObject());
break;
- case m_getID:
+ case this.m_getID:
result=server.getID();
break;
case m_getTemporaryQueue:
@@ -253,8 +264,8 @@
void failure(String st,Exception e)
{
- Log.log("Closing socket: "+st);
- Log.log(e);
+ Log.error("Closing socket: "+st);
+ Log.error(e);
}
// --
@@ -268,4 +279,20 @@
server=s;
}
+ int serverBindPort=0;
+
+ public void init(JMSServer s, org.jbossmq.xml.XElement config)
+ {
+ server=s;
+ try {
+ if( config.containsField("Port") ) {
+ Log.log("Port configured to: "+config.getField("Port"));
+ serverBindPort = Integer.parseInt( config.getField("Port") );
+ }
+ } catch ( Exception e ) {
+ Log.error("Config file was invalid.");
+ Log.error(e);
+ }
+ exportObject();
+ }
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development