[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting ...
Tom Elrod
tom.elrod at jboss.com
Wed Jul 19 12:34:48 EDT 2006
User: telrod
Date: 06/07/19 12:34:48
Modified: src/main/org/jboss/remoting Client.java
Log:
JBREM-527 - adding ability to pass invoker locator of stream server to create internally.
Revision Changes Path
1.45 +26 -11 JBossRemoting/src/main/org/jboss/remoting/Client.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Client.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/Client.java,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -b -r1.44 -r1.45
--- Client.java 24 Jun 2006 03:53:06 -0000 1.44
+++ Client.java 19 Jul 2006 16:34:48 -0000 1.45
@@ -59,7 +59,7 @@
*
* @author <a href="mailto:jhaynie at vocalocity.net">Jeff Haynie</a>
* @author <a href="mailto:telrod at e2technologies.net">Tom Elrod</a>
- * @version $Revision: 1.44 $
+ * @version $Revision: 1.45 $
*/
public class Client implements Externalizable
{
@@ -86,21 +86,15 @@
/**
* Key for the configuration map passed to the Client constructor
- * to indicate that client should not make initial request to establish
- * lease with server. May be needed when connecting to non-remoting server
- * (especially if using http client only). The value for this should be
+ * to indicate that client should make initial request to establish
+ * lease with server. The value for this should be
* either a String that java.lang.Boolean can evaluate or a java.lang.Boolean.
+ * Client leasing is turned off by default, so would need to use this property
+ * to turn client leasing on.
*/
public static final String ENABLE_LEASE = "ENABLE_LEASE";
/**
- * Key for the configuration map passed to the Client constructor
- * to indicate the socket factory to be used. This will override the
- * creation of any other socket factory.
- */
- public static final String CUSTOM_SOCKET_FACTORY = "CUSTOM_SOCKET_FACTORY";
-
- /**
* Key for the configuration map passed to the Client constructor providing a
* ssl javax.net.ssl.HandshakeCompletedListener implementation, which will
* be called on when ssl handshake completed with server.
@@ -1217,6 +1211,27 @@
return invoke(new InternalInvocation(InternalInvocation.ADDSTREAMCALLBACK, new Object[]{locator, invocationRequest}), null);
}
+ /**
+ * Takes an inputstream and wraps a server around. Then calls the target remoting server and passes proxy for
+ * an inputstream to the server's handler. When the server handle calls on this proxy, it will call back on this server
+ * wrapped around this inputstream. The InvokerLocator passed is used to create the internal Connector used to receive the
+ * calls from the server side.
+ * @param inputStream
+ * @param param
+ * @param streamServerLocator
+ * @return
+ * @throws Throwable
+ */
+ public Object invoke(InputStream inputStream, Object param, InvokerLocator streamServerLocator) throws Throwable
+ {
+ StreamServer streamServer = new StreamServer(inputStream, streamServerLocator);
+ String locator = streamServer.getInvokerLocator();
+
+ // now call on target server and pass locator for stream callbacks
+ InvocationRequest invocationRequest = new InvocationRequest(sessionId, subsystem, param, null, null, null);
+ return invoke(new InternalInvocation(InternalInvocation.ADDSTREAMCALLBACK, new Object[]{locator, invocationRequest}), null);
+ }
+
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
int version = in.readInt();
More information about the jboss-cvs-commits
mailing list