[jboss-svn-commits] JBoss Common SVN: r4200 - invokablecontainer/trunk/api/src/main/java/org/jboss/invokable.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon Mar 29 13:47:29 EDT 2010
Author: david.lloyd at jboss.com
Date: 2010-03-29 13:47:28 -0400 (Mon, 29 Mar 2010)
New Revision: 4200
Added:
invokablecontainer/trunk/api/src/main/java/org/jboss/invokable/InvocationTransport.java
invokablecontainer/trunk/api/src/main/java/org/jboss/invokable/InvocationTransportConnection.java
Removed:
invokablecontainer/trunk/api/src/main/java/org/jboss/invokable/InvocationForwarder.java
Modified:
invokablecontainer/trunk/api/src/main/java/org/jboss/invokable/ClientInvocationContext.java
invokablecontainer/trunk/api/src/main/java/org/jboss/invokable/ForwardedInvocationDispatcher.java
invokablecontainer/trunk/api/src/main/java/org/jboss/invokable/NodeAssociation.java
invokablecontainer/trunk/api/src/main/java/org/jboss/invokable/ServerInvocationContext.java
Log:
Remove InvocationForwarder
Modified: invokablecontainer/trunk/api/src/main/java/org/jboss/invokable/ClientInvocationContext.java
===================================================================
--- invokablecontainer/trunk/api/src/main/java/org/jboss/invokable/ClientInvocationContext.java 2010-03-29 15:53:41 UTC (rev 4199)
+++ invokablecontainer/trunk/api/src/main/java/org/jboss/invokable/ClientInvocationContext.java 2010-03-29 17:47:28 UTC (rev 4200)
@@ -55,12 +55,6 @@
return context;
}
- private final Map<String, InvocationForwarder> forwarders = new CopyOnWriteHashMap<String, InvocationForwarder>();
-
- protected InvocationForwarder getForwarder(String remoteNodeName, String remoteContextName) {
- return forwarders.get(remoteContextName);
- }
-
public void start() {
if (current.get() != null) {
throw new IllegalStateException("A client invocation context is already associated with the current thread");
Modified: invokablecontainer/trunk/api/src/main/java/org/jboss/invokable/ForwardedInvocationDispatcher.java
===================================================================
--- invokablecontainer/trunk/api/src/main/java/org/jboss/invokable/ForwardedInvocationDispatcher.java 2010-03-29 15:53:41 UTC (rev 4199)
+++ invokablecontainer/trunk/api/src/main/java/org/jboss/invokable/ForwardedInvocationDispatcher.java 2010-03-29 17:47:28 UTC (rev 4200)
@@ -49,13 +49,7 @@
}
public InvocationReply dispatch(final Invocation invocation) throws InvocationException {
- final NodeAssociation association = nodeInvocationContext.getNodeAssociation(dispatcherLocation.getNodeLocation());
- final DispatcherIdentifier dispatcherIdentifier = dispatcherLocation.getDispatcherIdentifier();
- try {
- return association.getInvocationForwarder(dispatcherIdentifier.getContextName()).dispatch(dispatcherIdentifier.getDispatcherName(), invocation);
- } catch (IOException e) {
- throw new IOError(e);
- }
+ return null;
}
public <I> void accept(final Visitor<InvocationDispatcher, I> visitor, final I param) {
Deleted: invokablecontainer/trunk/api/src/main/java/org/jboss/invokable/InvocationForwarder.java
===================================================================
--- invokablecontainer/trunk/api/src/main/java/org/jboss/invokable/InvocationForwarder.java 2010-03-29 15:53:41 UTC (rev 4199)
+++ invokablecontainer/trunk/api/src/main/java/org/jboss/invokable/InvocationForwarder.java 2010-03-29 17:47:28 UTC (rev 4200)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This 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 (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.invokable;
-
-import java.io.IOException;
-
-/**
- * Forwards an invocation to a remote Server Invocation Context, possibly across some network connection. While an
- * {@code InvocationDispatcher} represents a single invocation target, instances of this interface represent a single
- * network path to a peer, which may have many {@code InvocationDispatcher}s on the receiving side. An instance of
- * this interface is associated with one remote Server Invocation Context or a cluster of Server Invocation Contexts.
- *
- * @author <a href="mailto:david.lloyd at redhat.com">David M. Lloyd</a>
- */
-public interface InvocationForwarder {
-
- /**
- * Send an invocation across the network.
- *
- * @param dispatcherName the identifier of the dispatcher to use on the remote side
- * @param invocation the invocation to execute
- * @return the result of the invocation
- * @throws IOException if an I/O error occurs
- * @throws InvocationException if a remote invocation failed
- */
- InvocationReply dispatch(String dispatcherName, Invocation invocation) throws IOException, InvocationException;
-}
Added: invokablecontainer/trunk/api/src/main/java/org/jboss/invokable/InvocationTransport.java
===================================================================
--- invokablecontainer/trunk/api/src/main/java/org/jboss/invokable/InvocationTransport.java (rev 0)
+++ invokablecontainer/trunk/api/src/main/java/org/jboss/invokable/InvocationTransport.java 2010-03-29 17:47:28 UTC (rev 4200)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.invokable;
+
+import java.io.IOException;
+import java.net.URI;
+
+/**
+ * @author <a href="mailto:david.lloyd at redhat.com">David M. Lloyd</a>
+ */
+public interface InvocationTransport {
+ String getName();
+
+ InvocationTransportConnection connectTo(URI connectUri) throws IOException;
+}
Added: invokablecontainer/trunk/api/src/main/java/org/jboss/invokable/InvocationTransportConnection.java
===================================================================
--- invokablecontainer/trunk/api/src/main/java/org/jboss/invokable/InvocationTransportConnection.java (rev 0)
+++ invokablecontainer/trunk/api/src/main/java/org/jboss/invokable/InvocationTransportConnection.java 2010-03-29 17:47:28 UTC (rev 4200)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.invokable;
+
+
+/**
+ * @author <a href="mailto:david.lloyd at redhat.com">David M. Lloyd</a>
+ */
+public interface InvocationTransportConnection {
+ InvocationDispatcher getDispatcher(String contextName, String dispatcherName);
+
+}
Modified: invokablecontainer/trunk/api/src/main/java/org/jboss/invokable/NodeAssociation.java
===================================================================
--- invokablecontainer/trunk/api/src/main/java/org/jboss/invokable/NodeAssociation.java 2010-03-29 15:53:41 UTC (rev 4199)
+++ invokablecontainer/trunk/api/src/main/java/org/jboss/invokable/NodeAssociation.java 2010-03-29 17:47:28 UTC (rev 4200)
@@ -28,12 +28,5 @@
* @author <a href="mailto:david.lloyd at redhat.com">David M. Lloyd</a>
*/
public interface NodeAssociation {
-
- /**
- * Get an invocation forwarder for the associated remote node.
- *
- * @param contextName the context name
- * @return the dispatcher, or {@code null} if none matched
- */
- InvocationForwarder getInvocationForwarder(String contextName);
+
}
Modified: invokablecontainer/trunk/api/src/main/java/org/jboss/invokable/ServerInvocationContext.java
===================================================================
--- invokablecontainer/trunk/api/src/main/java/org/jboss/invokable/ServerInvocationContext.java 2010-03-29 15:53:41 UTC (rev 4199)
+++ invokablecontainer/trunk/api/src/main/java/org/jboss/invokable/ServerInvocationContext.java 2010-03-29 17:47:28 UTC (rev 4200)
@@ -73,17 +73,6 @@
}
}
- private final InvocationForwarder loopback = new InvocationForwarder() {
- public InvocationReply dispatch(final String identifier, final Invocation invocation) throws IOException, InvocationException {
- final Reg reg = exportedDispatchers.get(identifier);
- if (reg != null) {
- return reg.processor.processInvocation(reg.localDispatcher, invocation);
- } else {
- throw new IOException("No dispatcher found named \"" + identifier + "\"");
- }
- }
- };
-
public InvocationDispatcher export(InvocationDispatcher dispatcher, String name) {
dispatcher.accept(new Visitor<InvocationDispatcher, Void>() {
public void visit(final InvocationDispatcher visited, final Void parameter) {
@@ -95,14 +84,6 @@
return new ExportedInvocationDispatcher(nodeInvocationContext, new DispatcherIdentifier(getName(), name));
}
- protected InvocationForwarder getForwarder(final String remoteNodeName, final String remoteContextName) {
- if (name.equals(remoteContextName) && remoteNodeName.equals(NodeInvocationContext.getCurrent().getName())) {
- return loopback;
- } else {
- return super.getForwarder(remoteNodeName, remoteContextName);
- }
- }
-
public String getName() {
return name;
}
More information about the jboss-svn-commits
mailing list