Author: david.lloyd(a)jboss.com
Date: 2008-10-22 20:50:37 -0400 (Wed, 22 Oct 2008)
New Revision: 4614
Added:
remoting3/trunk/api/src/main/java/org/jboss/remoting/ClientSourceWrapper.java
remoting3/trunk/api/src/main/java/org/jboss/remoting/ClientWrapper.java
remoting3/trunk/api/src/main/java/org/jboss/remoting/EndpointWrapper.java
remoting3/trunk/api/src/main/java/org/jboss/remoting/RequestContextWrapper.java
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/Handle.java
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/RemoteRequestContext.java
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/ReplyHandler.java
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/RequestHandler.java
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/RequestHandlerSource.java
Removed:
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/remote/
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/stream/
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/wrapper/
remoting3/trunk/api/src/main/java/org/jboss/remoting/stream/ByteBufferInputStream.java
remoting3/trunk/api/src/main/java/org/jboss/remoting/stream/ByteBufferOutputStream.java
remoting3/trunk/api/src/main/java/org/jboss/remoting/stream/CharBufferReader.java
remoting3/trunk/api/src/main/java/org/jboss/remoting/stream/CharBufferWriter.java
remoting3/trunk/api/src/test/java/org/jboss/remoting/stream/ByteBufferInputStreamTestCase.java
remoting3/trunk/api/src/test/java/org/jboss/remoting/stream/ByteBufferOutputStreamTestCase.java
remoting3/trunk/api/src/test/java/org/jboss/remoting/stream/CharBufferReaderTestCase.java
remoting3/trunk/api/src/test/java/org/jboss/remoting/stream/CharBufferWriterTestCase.java
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/service/
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/stream/
remoting3/trunk/protocol/multiplex/src/main/java/org/jboss/remoting/protocol/multiplex/StreamContextImpl.java
remoting3/trunk/tools/
Modified:
remoting3/trunk/api/src/main/java/org/jboss/remoting/Endpoint.java
remoting3/trunk/api/src/main/java/org/jboss/remoting/ServiceListener.java
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/AbstractAutoCloseable.java
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/SpiUtils.java
remoting3/trunk/api/src/main/resources/META-INF/jboss-classloading.xml
remoting3/trunk/api/src/test/java/org/jboss/remoting/spi/CloseableTestCase.java
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/ClientExternalizer.java
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/ClientImpl.java
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/ClientSourceExternalizer.java
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/ClientSourceImpl.java
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/EndpointImpl.java
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/FutureReplyImpl.java
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/LocalRequestHandler.java
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/LocalRequestHandlerSource.java
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/RequestContextImpl.java
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/ServiceRegistration.java
remoting3/trunk/core/src/test/java/org/jboss/remoting/core/EndpointTestCase.java
remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/BasicConfiguration.java
remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/BasicHandlerReplyConsumer.java
remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/BasicProtocol.java
remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/BasicRequestHandler.java
remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/BasicServerReplyTransmitter.java
remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/BasicServerRequestConsumer.java
remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/FutureBasicReply.java
remoting3/trunk/protocol/basic/src/test/java/org/jboss/remoting/protocol/basic/BasicTestCase.java
remoting3/trunk/protocol/multiplex/src/main/java/org/jboss/remoting/protocol/multiplex/MultiplexHandler.java
remoting3/trunk/protocol/multiplex/src/main/java/org/jboss/remoting/protocol/multiplex/MultiplexProtocol.java
remoting3/trunk/protocol/multiplex/src/main/java/org/jboss/remoting/protocol/multiplex/RemotingChannelConfiguration.java
remoting3/trunk/standalone/src/main/java/org/jboss/remoting/Remoting.java
remoting3/trunk/transporter/src/main/java/org/jboss/remoting/transporter/Transporter.java
Log:
More major code cleanup
Copied: remoting3/trunk/api/src/main/java/org/jboss/remoting/ClientSourceWrapper.java
(from rev 4601,
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/wrapper/ClientSourceWrapper.java)
===================================================================
--- remoting3/trunk/api/src/main/java/org/jboss/remoting/ClientSourceWrapper.java
(rev 0)
+++
remoting3/trunk/api/src/main/java/org/jboss/remoting/ClientSourceWrapper.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -0,0 +1,50 @@
+package org.jboss.remoting;
+
+import org.jboss.remoting.CloseHandler;
+import org.jboss.remoting.Client;
+import org.jboss.remoting.ClientSource;
+import java.io.IOException;
+
+/**
+ * A simple delegating wrapper for client sources.
+ *
+ * @param <I> the request type
+ * @param <O> the reply type
+ */
+public class ClientSourceWrapper<I, O> implements ClientSource<I, O> {
+ private final ClientSource<I, O> delegate;
+
+ /**
+ * Construct a new instance. Calls will be sent to the given {@code delegate} by
default.
+ *
+ * @param delegate the delegate client instance
+ */
+ protected ClientSourceWrapper(ClientSource<I, O> delegate) {
+ this.delegate = delegate;
+ }
+
+ /**
+ * {@inheritDoc} This implementation calls the same method on the delegate object.
+ */
+ public void close() throws IOException {
+ delegate.close();
+ }
+
+ /**
+ * {@inheritDoc} This implementation calls the same method on the delegate object.
+ */
+ public void addCloseHandler(final CloseHandler<? super ClientSource<I,
O>> closeHandler) {
+ delegate.addCloseHandler(new CloseHandler<ClientSource<I, O>>() {
+ public void handleClose(final ClientSource<I, O> closed) {
+ closeHandler.handleClose(ClientSourceWrapper.this);
+ }
+ });
+ }
+
+ /**
+ * {@inheritDoc} This implementation calls the same method on the delegate object.
+ */
+ public Client<I, O> createClient() throws IOException {
+ return delegate.createClient();
+ }
+}
Copied: remoting3/trunk/api/src/main/java/org/jboss/remoting/ClientWrapper.java (from rev
4611,
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/wrapper/ClientWrapper.java)
===================================================================
--- remoting3/trunk/api/src/main/java/org/jboss/remoting/ClientWrapper.java
(rev 0)
+++ remoting3/trunk/api/src/main/java/org/jboss/remoting/ClientWrapper.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -0,0 +1,65 @@
+package org.jboss.remoting;
+
+import java.util.concurrent.ConcurrentMap;
+import java.io.IOException;
+import org.jboss.remoting.CloseHandler;
+import org.jboss.remoting.Client;
+import org.jboss.xnio.IoFuture;
+
+/**
+ * A simple delegating wrapper for clients.
+ *
+ * @param <I> the request type
+ * @param <O> the reply type
+ */
+public class ClientWrapper<I, O> implements Client<I, O> {
+ protected final Client<I, O> delegate;
+
+ /**
+ * Construct a new instance. Calls will be sent to the given {@code delegate} by
default.
+ *
+ * @param delegate the delegate client instance
+ */
+ protected ClientWrapper(final Client<I, O> delegate) {
+ this.delegate = delegate;
+ }
+
+ /**
+ * {@inheritDoc} This implementation calls the same method on the delegate object.
+ */
+ public void close() throws IOException {
+ delegate.close();
+ }
+
+ /**
+ * {@inheritDoc} This implementation calls the same method on the delegate object.
+ */
+ public void addCloseHandler(final CloseHandler<? super Client<I, O>>
closeHandler) {
+ delegate.addCloseHandler(new CloseHandler<Client<I, O>>() {
+ public void handleClose(final Client<I, O> closed) {
+ closeHandler.handleClose(ClientWrapper.this);
+ }
+ });
+ }
+
+ /**
+ * {@inheritDoc} This implementation calls the same method on the delegate object.
+ */
+ public O invoke(final I request) throws IOException {
+ return delegate.invoke(request);
+ }
+
+ /**
+ * {@inheritDoc} This implementation calls the same method on the delegate object.
+ */
+ public IoFuture<O> send(final I request) throws IOException {
+ return delegate.send(request);
+ }
+
+ /**
+ * {@inheritDoc} This implementation calls the same method on the delegate object.
+ */
+ public ConcurrentMap<Object, Object> getAttributes() {
+ return delegate.getAttributes();
+ }
+}
Modified: remoting3/trunk/api/src/main/java/org/jboss/remoting/Endpoint.java
===================================================================
--- remoting3/trunk/api/src/main/java/org/jboss/remoting/Endpoint.java 2008-10-23 00:14:24
UTC (rev 4613)
+++ remoting3/trunk/api/src/main/java/org/jboss/remoting/Endpoint.java 2008-10-23 00:50:37
UTC (rev 4614)
@@ -3,9 +3,9 @@
import java.util.concurrent.ConcurrentMap;
import java.net.URI;
import java.io.IOException;
-import org.jboss.remoting.spi.remote.RequestHandler;
-import org.jboss.remoting.spi.remote.RequestHandlerSource;
-import org.jboss.remoting.spi.remote.Handle;
+import org.jboss.remoting.spi.RequestHandler;
+import org.jboss.remoting.spi.RequestHandlerSource;
+import org.jboss.remoting.spi.Handle;
import org.jboss.xnio.IoFuture;
/**
Copied: remoting3/trunk/api/src/main/java/org/jboss/remoting/EndpointWrapper.java (from
rev 4601,
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/wrapper/EndpointWrapper.java)
===================================================================
--- remoting3/trunk/api/src/main/java/org/jboss/remoting/EndpointWrapper.java
(rev 0)
+++ remoting3/trunk/api/src/main/java/org/jboss/remoting/EndpointWrapper.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -0,0 +1,94 @@
+package org.jboss.remoting;
+
+import java.util.concurrent.ConcurrentMap;
+import java.io.IOException;
+import java.net.URI;
+import org.jboss.remoting.Endpoint;
+import org.jboss.remoting.RequestListener;
+import org.jboss.remoting.Client;
+import org.jboss.remoting.ClientSource;
+import org.jboss.remoting.SimpleCloseable;
+import org.jboss.remoting.ServiceListener;
+import org.jboss.remoting.spi.RequestHandler;
+import org.jboss.remoting.spi.RequestHandlerSource;
+import org.jboss.remoting.spi.Handle;
+import org.jboss.xnio.IoFuture;
+
+/**
+ * A simple delegating wrapper for endpoints.
+ */
+public class EndpointWrapper implements Endpoint {
+ protected final Endpoint delegate;
+
+ /**
+ * Construct a new instance. Calls will be sent to the given {@code delegate} by
default.
+ *
+ * @param delegate the delegate client instance
+ */
+ protected EndpointWrapper(final Endpoint delegate) {
+ this.delegate = delegate;
+ }
+
+ /**
+ * {@inheritDoc} This implementation calls the same method on the delegate object.
+ */
+ public ConcurrentMap<Object, Object> getAttributes() {
+ return delegate.getAttributes();
+ }
+
+ /**
+ * {@inheritDoc} This implementation calls the same method on the delegate object.
+ */
+ public String getName() {
+ return delegate.getName();
+ }
+
+ /**
+ * {@inheritDoc} This implementation calls the same method on the delegate object.
+ */
+ public <I, O> Handle<RequestHandler> createRequestHandler(final
RequestListener<I, O> requestListener) throws IOException {
+ return delegate.createRequestHandler(requestListener);
+ }
+
+ /**
+ * {@inheritDoc} This implementation calls the same method on the delegate object.
+ */
+ public <I, O> Handle<RequestHandlerSource>
createRequestHandlerSource(final RequestListener<I, O> requestListener, final String
serviceType, final String groupName) throws IOException {
+ return delegate.createRequestHandlerSource(requestListener, serviceType,
groupName);
+ }
+
+ /**
+ * {@inheritDoc} This implementation calls the same method on the delegate object.
+ */
+ public <I, O> Client<I, O> createClient(final RequestHandler handler)
throws IOException {
+ return delegate.createClient(handler);
+ }
+
+ /**
+ * {@inheritDoc} This implementation calls the same method on the delegate object.
+ */
+ public <I, O> ClientSource<I, O> createClientSource(final
RequestHandlerSource handlerSource) throws IOException {
+ return delegate.createClientSource(handlerSource);
+ }
+
+ /**
+ * {@inheritDoc} This implementation calls the same method on the delegate object.
+ */
+ public <I, O> IoFuture<ClientSource<I, O>> locateService(final URI
serviceUri) throws IllegalArgumentException {
+ return delegate.locateService(serviceUri);
+ }
+
+ /**
+ * {@inheritDoc} This implementation calls the same method on the delegate object.
+ */
+ public SimpleCloseable registerRemoteService(final String serviceType, final String
groupName, final String endpointName, final RequestHandlerSource handlerSource, final int
metric) throws IllegalArgumentException, IOException {
+ return delegate.registerRemoteService(serviceType, groupName, endpointName,
handlerSource, metric);
+ }
+
+ /**
+ * {@inheritDoc} This implementation calls the same method on the delegate object.
+ */
+ public SimpleCloseable addServiceListener(final ServiceListener serviceListener,
final boolean onlyNew) {
+ return delegate.addServiceListener(serviceListener, true);
+ }
+}
Copied: remoting3/trunk/api/src/main/java/org/jboss/remoting/RequestContextWrapper.java
(from rev 4601,
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/wrapper/RequestContextWrapper.java)
===================================================================
--- remoting3/trunk/api/src/main/java/org/jboss/remoting/RequestContextWrapper.java
(rev 0)
+++
remoting3/trunk/api/src/main/java/org/jboss/remoting/RequestContextWrapper.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -0,0 +1,73 @@
+package org.jboss.remoting;
+
+import org.jboss.remoting.RequestCancelHandler;
+import org.jboss.remoting.RequestContext;
+import org.jboss.remoting.ClientContext;
+import java.io.IOException;
+
+/**
+ * A simple delegating wrapper for request context instances.
+ *
+ * @param <O> the reply type
+ */
+public class RequestContextWrapper<O> implements RequestContext<O> {
+ protected final RequestContext<O> delegate;
+
+ /**
+ * Construct a new instance. Calls will be sent to the given {@code delegate} by
default.
+ *
+ * @param delegate the delegate client instance
+ */
+ protected RequestContextWrapper(final RequestContext<O> delegate) {
+ this.delegate = delegate;
+ }
+
+ /**
+ * {@inheritDoc} This implementation calls the same method on the delegate object.
+ */
+ public ClientContext getContext() {
+ return delegate.getContext();
+ }
+
+ /**
+ * {@inheritDoc} This implementation calls the same method on the delegate object.
+ */
+ public boolean isCancelled() {
+ return delegate.isCancelled();
+ }
+
+ /**
+ * {@inheritDoc} This implementation calls the same method on the delegate object.
+ */
+ public void sendReply(O reply) throws IOException, IllegalStateException {
+ delegate.sendReply(reply);
+ }
+
+ /**
+ * {@inheritDoc} This implementation calls the same method on the delegate object.
+ */
+ public void sendFailure(String msg, Throwable cause) throws IOException,
IllegalStateException {
+ delegate.sendFailure(msg, cause);
+ }
+
+ /**
+ * {@inheritDoc} This implementation calls the same method on the delegate object.
+ */
+ public void sendCancelled() throws IOException, IllegalStateException {
+ delegate.sendCancelled();
+ }
+
+ /**
+ * {@inheritDoc} This implementation calls the same method on the delegate object.
+ */
+ public void addCancelHandler(final RequestCancelHandler<O>
requestCancelHandler) {
+ delegate.addCancelHandler(requestCancelHandler);
+ }
+
+ /**
+ * {@inheritDoc} This implementation calls the same method on the delegate object.
+ */
+ public void execute(final Runnable command) {
+ delegate.execute(command);
+ }
+}
Modified: remoting3/trunk/api/src/main/java/org/jboss/remoting/ServiceListener.java
===================================================================
--- remoting3/trunk/api/src/main/java/org/jboss/remoting/ServiceListener.java 2008-10-23
00:14:24 UTC (rev 4613)
+++ remoting3/trunk/api/src/main/java/org/jboss/remoting/ServiceListener.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -22,7 +22,7 @@
package org.jboss.remoting;
-import org.jboss.remoting.spi.remote.RequestHandlerSource;
+import org.jboss.remoting.spi.RequestHandlerSource;
/**
* A listener for watching service registrations on an endpoint.
Modified:
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/AbstractAutoCloseable.java
===================================================================
---
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/AbstractAutoCloseable.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/AbstractAutoCloseable.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -26,7 +26,7 @@
import java.util.concurrent.atomic.AtomicInteger;
import java.io.IOException;
import org.jboss.remoting.RemotingException;
-import org.jboss.remoting.spi.remote.Handle;
+import org.jboss.remoting.spi.Handle;
import org.jboss.xnio.log.Logger;
/**
Copied: remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/Handle.java (from rev
4601, remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/remote/Handle.java)
===================================================================
--- remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/Handle.java
(rev 0)
+++ remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/Handle.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, 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.remoting.spi;
+
+import org.jboss.remoting.HandleableCloseable;
+import org.jboss.remoting.CloseHandler;
+import java.io.IOException;
+
+/**
+ * A handle to a local resource.
+ */
+public interface Handle<T> extends HandleableCloseable<Handle<T>> {
+
+ /**
+ * Get the resource.
+ *
+ * @return the resource
+ */
+ T getResource();
+
+ /**
+ * Close this reference.
+ *
+ * @throws IOException if the close failed
+ */
+ void close() throws IOException;
+
+ /**
+ * Add a handler that is invoked when this handle is closed.
+ *
+ * @param handler the handler
+ */
+ void addCloseHandler(final CloseHandler<? super Handle<T>> handler);
+}
Copied: remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/RemoteRequestContext.java
(from rev 4601,
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/remote/RemoteRequestContext.java)
===================================================================
--- remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/RemoteRequestContext.java
(rev 0)
+++
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/RemoteRequestContext.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, 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.remoting.spi;
+
+/**
+ * The context of an outstanding remote request. This instance should be discarded when
a reply (of any sort)
+ * is received for the request.
+ */
+public interface RemoteRequestContext {
+
+ /**
+ * Signal that the request should be cancelled, if possible.
+ */
+ void cancel();
+}
Copied: remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/ReplyHandler.java (from
rev 4607,
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/remote/ReplyHandler.java)
===================================================================
--- remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/ReplyHandler.java
(rev 0)
+++ remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/ReplyHandler.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, 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.remoting.spi;
+
+import java.io.IOException;
+
+/**
+ * A handler for replies from a request. The handler should respect the first invocation
made on it, and ignore
+ * any subsequent invocations.
+ */
+public interface ReplyHandler {
+
+ /**
+ * Handle a successful reply. If the reply could not be forwarded, an exception is
thrown.
+ *
+ * @param reply the reply
+ */
+ void handleReply(Object reply) throws IOException;
+
+ /**
+ * Handle an exception. If the exception could not be forwarded, a (different)
{@code IOException} is thrown.
+ *
+ * @param exception an exception which describes the problem
+ */
+ void handleException(IOException exception) throws IOException;
+
+ /**
+ * Handle a cancellation acknowledgement. If the cancellation acknowledgement could
not be forwarded, an
+ * exception is thrown.
+ */
+ void handleCancellation() throws IOException;
+}
Copied: remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/RequestHandler.java (from
rev 4611,
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/remote/RequestHandler.java)
===================================================================
--- remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/RequestHandler.java
(rev 0)
+++
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/RequestHandler.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, 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.remoting.spi;
+
+import org.jboss.remoting.HandleableCloseable;
+import org.jboss.remoting.RemotingException;
+import org.jboss.remoting.CloseHandler;
+import java.io.IOException;
+
+/**
+ * A request handler, which can be passed to remote endpoints. Remote systems can then
use the handler
+ * to make invocations, or they may forward a handler on to other remote systems.
+ */
+public interface RequestHandler extends HandleableCloseable<RequestHandler> {
+
+ /**
+ * Receive a request from a remote system. This method is intended to be called by
protocol handlers. If the
+ * request cannot be accepted for some reason, the
+ * {@link ReplyHandler#handleException(java.io.IOException)}
+ * method is called immediately.
+ *
+ * @param request the request
+ * @param replyHandler a handler for the reply
+ * @return a context which may be used to cancel the request
+ */
+ RemoteRequestContext receiveRequest(Object request, ReplyHandler replyHandler);
+
+ /**
+ * Get a handle to this request handler. The request handler will not auto-close as
long as there is at least
+ * one open handle. If a handle is "leaked", it will be closed
+ * automatically if/when the garbage collector invokes its {@link Object#finalize()}
method, with a log message
+ * warning of the leak.
+ *
+ * @return the handle
+ * @throws IOException if a handle could not be acquired
+ */
+ Handle<RequestHandler> getHandle() throws IOException;
+
+ /**
+ * Close this request handler. The outcome of any outstanding requests is not
defined, though implementations
+ * should make an effort to cancel any outstanding requests.
+ *
+ * @throws RemotingException if the client endpoint could not be closed
+ */
+ void close() throws IOException;
+
+ /**
+ * Add a handler that is called when the request handler is closed.
+ *
+ * @param handler the handler to be called
+ */
+ void addCloseHandler(final CloseHandler<? super RequestHandler> handler);
+}
Copied: remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/RequestHandlerSource.java
(from rev 4601,
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/remote/RequestHandlerSource.java)
===================================================================
--- remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/RequestHandlerSource.java
(rev 0)
+++
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/RequestHandlerSource.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, 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.remoting.spi;
+
+import org.jboss.remoting.HandleableCloseable;
+import org.jboss.remoting.RemotingException;
+import org.jboss.remoting.CloseHandler;
+import java.io.IOException;
+
+/**
+ * A request handler source, which can be passed to remote endpoints. Remote systems can
then use the handler source
+ * to acquire request handlers, or they may pass it on to other systems. Acquiring a
request handler using this method
+ * has the advantage that a round trip to the remote side is not necessary; the local
side can spawn a request handler
+ * and simply notify the remote side of the change.
+ */
+public interface RequestHandlerSource extends
HandleableCloseable<RequestHandlerSource> {
+
+ /**
+ * Create a request handler for the service corresponding to this request handler
source.
+ *
+ * @return a request handler
+ * @throws RemotingException if a client could not be opened
+ */
+ Handle<RequestHandler> createRequestHandler() throws IOException;
+
+ /**
+ * Get a handle to this request handler source. The request handler source will not
auto-close as long as there is at least
+ * one open handle, or request handler. If a handle is "leaked", it will
be closed
+ * automatically if/when the garbage collector invokes its {@link Object#finalize()}
method, with a log message
+ * warning of the leak.
+ *
+ * @return the handle
+ * @throws RemotingException if a handle could not be acquired
+ */
+ Handle<RequestHandlerSource> getHandle() throws IOException;
+
+ /**
+ * Close this request handler source immediately.
+ */
+ void close() throws IOException;
+
+ /**
+ * Add a handler that is called when the request handler source is closed.
+ *
+ * @param handler the handler to be called
+ */
+ void addCloseHandler(final CloseHandler<? super RequestHandlerSource>
handler);
+}
Modified: remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/SpiUtils.java
===================================================================
--- remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/SpiUtils.java 2008-10-23
00:14:24 UTC (rev 4613)
+++ remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/SpiUtils.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -22,8 +22,8 @@
package org.jboss.remoting.spi;
-import org.jboss.remoting.spi.remote.ReplyHandler;
-import org.jboss.remoting.spi.remote.RemoteRequestContext;
+import org.jboss.remoting.spi.ReplyHandler;
+import org.jboss.remoting.spi.RemoteRequestContext;
import org.jboss.remoting.RequestCancelHandler;
import org.jboss.remoting.RequestContext;
import org.jboss.remoting.CloseHandler;
Deleted:
remoting3/trunk/api/src/main/java/org/jboss/remoting/stream/ByteBufferInputStream.java
===================================================================
---
remoting3/trunk/api/src/main/java/org/jboss/remoting/stream/ByteBufferInputStream.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/api/src/main/java/org/jboss/remoting/stream/ByteBufferInputStream.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -1,126 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, 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.remoting.stream;
-
-import java.io.InputStream;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import org.jboss.xnio.BufferAllocator;
-import org.jboss.xnio.IoUtils;
-
-/**
- * An input stream that reads from byte buffers. Instances of this class are not safe to
use concurrently from
- * multiple threads.
- */
-public final class ByteBufferInputStream extends InputStream {
- private final ObjectSource<ByteBuffer> bufferSource;
- private final BufferAllocator<ByteBuffer> allocator;
-
- private boolean closed;
- private ByteBuffer current;
-
- public ByteBufferInputStream(final ObjectSource<ByteBuffer> bufferSource, final
BufferAllocator<ByteBuffer> allocator) {
- this.bufferSource = bufferSource;
- this.allocator = allocator;
- }
-
- public int read() throws IOException {
- if (closed) {
- return -1;
- }
- ByteBuffer buffer = getBuffer();
- if (buffer == null) {
- return -1;
- }
- try {
- return buffer.get() & 0xff;
- } finally {
- if (! buffer.hasRemaining()) {
- current = null;
- allocator.free(buffer);
- }
- }
- }
-
- public int read(final byte[] b, int off, int len) throws IOException {
- if (closed) {
- return -1;
- }
- int t = 0;
- while (len > 0) {
- ByteBuffer buffer = getBuffer();
- if (buffer == null) {
- return t == 0 ? -1 : t;
- }
- final int rem = Math.min(len, buffer.remaining());
- if (rem > 0) {
- buffer.get(b, off, rem);
- off += rem;
- len -= rem;
- t += rem;
- }
- if (! buffer.hasRemaining()) {
- current = null;
- allocator.free(buffer);
- }
- }
- return t;
- }
-
- public int available() throws IOException {
- final ByteBuffer buffer = current;
- return (buffer == null ? 0 : buffer.remaining());
- }
-
- public void close() throws IOException {
- try {
- final ByteBuffer buffer = current;
- current = null;
- if (buffer != null) {
- allocator.free(buffer);
- }
- bufferSource.close();
- } finally {
- closed = true;
- IoUtils.safeClose(bufferSource);
- }
- }
-
- private ByteBuffer getBuffer() throws IOException {
- final ByteBuffer buffer = current;
- if (buffer == null) {
- while (bufferSource.hasNext()) {
- final ByteBuffer newBuffer = bufferSource.next();
- if (newBuffer.hasRemaining()) {
- current = newBuffer;
- return newBuffer;
- } else {
- allocator.free(newBuffer);
- }
- }
- return null;
- } else {
- return buffer;
- }
- }
-}
Deleted:
remoting3/trunk/api/src/main/java/org/jboss/remoting/stream/ByteBufferOutputStream.java
===================================================================
---
remoting3/trunk/api/src/main/java/org/jboss/remoting/stream/ByteBufferOutputStream.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/api/src/main/java/org/jboss/remoting/stream/ByteBufferOutputStream.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -1,132 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, 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.remoting.stream;
-
-import java.io.OutputStream;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import org.jboss.xnio.BufferAllocator;
-import org.jboss.xnio.IoUtils;
-import org.jboss.xnio.Buffers;
-
-/**
- * An output stream that writes to buffers. Instances of this class are not normally
safe to use from multiple threads
- * concurrently.
- */
-public final class ByteBufferOutputStream extends OutputStream {
- private final ObjectSink<ByteBuffer> bufferSink;
- private final BufferAllocator<ByteBuffer> allocator;
-
- private ByteBuffer current;
- private boolean closed;
-
- /**
- * Construct a new stream instance.
- *
- * @param bufferSink the buffer sink to which full buffers will be written
- * @param allocator the allocator from which empty buffers will be allocated
- */
- public ByteBufferOutputStream(final ObjectSink<ByteBuffer> bufferSink, final
BufferAllocator<ByteBuffer> allocator) {
- this.bufferSink = bufferSink;
- this.allocator = allocator;
- }
-
- private ByteBuffer getBuffer() throws IOException {
- final ByteBuffer buffer = current;
- if (buffer == null) {
- ByteBuffer newbuf = allocator.allocate();
- if (newbuf == null) {
- throw new IOException("No buffers available");
- }
- current = newbuf;
- return newbuf;
- } else {
- return buffer;
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void write(final int b) throws IOException {
- if (closed) {
- throw new IOException("Write to closed outputstream");
- }
- final ByteBuffer buffer = getBuffer();
- buffer.put((byte)b);
- if (! buffer.hasRemaining()) {
- localFlush();
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void write(final byte[] b, int off, int len) throws IOException {
- if (closed) {
- throw new IOException("Write to closed outputstream");
- }
- do {
- final ByteBuffer buffer = getBuffer();
- final int rem = Math.min(len, buffer.remaining());
- buffer.put(b, off, rem);
- if (! buffer.hasRemaining()) {
- localFlush();
- }
- len -= rem; off += rem;
- } while (len > 0);
- }
-
- private void localFlush() throws IOException {
- if (closed) {
- throw new IOException("Flush on closed outputstream");
- }
- final ByteBuffer buffer = current;
- if (buffer != null) try {
- bufferSink.accept(Buffers.flip(buffer));
- } finally {
- current = null;
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void flush() throws IOException {
- localFlush();
- bufferSink.flush();
- }
-
- /**
- * {@inheritDoc}
- */
- public void close() throws IOException {
- if (! closed) try {
- flush();
- bufferSink.close();
- } finally {
- closed = true;
- IoUtils.safeClose(bufferSink);
- }
- }
-}
Deleted:
remoting3/trunk/api/src/main/java/org/jboss/remoting/stream/CharBufferReader.java
===================================================================
---
remoting3/trunk/api/src/main/java/org/jboss/remoting/stream/CharBufferReader.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/api/src/main/java/org/jboss/remoting/stream/CharBufferReader.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -1,166 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, 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.remoting.stream;
-
-import java.io.IOException;
-import java.io.Reader;
-import java.nio.CharBuffer;
-import org.jboss.xnio.BufferAllocator;
-import org.jboss.xnio.IoUtils;
-
-/**
- * A reader that reads from char buffers. Instances of this class are not safe to use
concurrently from
- * multiple threads.
- */
-public final class CharBufferReader extends Reader {
- private final ObjectSource<CharBuffer> bufferSource;
- private final BufferAllocator<CharBuffer> allocator;
-
- private boolean closed;
- private CharBuffer current;
-
- public CharBufferReader(final ObjectSource<CharBuffer> bufferSource, final
BufferAllocator<CharBuffer> allocator) {
- this.bufferSource = bufferSource;
- this.allocator = allocator;
- }
-
- /**
- * {@inheritDoc}
- */
- public int read() throws IOException {
- if (closed) {
- return -1;
- }
- CharBuffer buffer = getBuffer();
- if (buffer == null) {
- return -1;
- }
- try {
- return buffer.get() & 0xff;
- } finally {
- if (! buffer.hasRemaining()) {
- current = null;
- allocator.free(buffer);
- }
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public int read(final char[] cbuf, int off, int len) throws IOException {
- if (closed) {
- return -1;
- }
- int t = 0;
- while (len > 0) {
- CharBuffer buffer = getBuffer();
- if (buffer == null) {
- return t == 0 ? -1 : t;
- }
- final int rem = Math.min(len, buffer.remaining());
- if (rem > 0) {
- buffer.get(cbuf, off, rem);
- off += rem;
- len -= rem;
- t += rem;
- }
- if (! buffer.hasRemaining()) {
- current = null;
- allocator.free(buffer);
- }
- }
- return t;
- }
-
- /**
- * {@inheritDoc}
- */
- public void close() throws IOException {
- try {
- final CharBuffer buffer = current;
- current = null;
- if (buffer != null) {
- allocator.free(buffer);
- }
- bufferSource.close();
- } finally {
- closed = true;
- IoUtils.safeClose(bufferSource);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public int read(final CharBuffer target) throws IOException {
- if (closed) {
- return -1;
- }
- int t = 0;
- int len = target.remaining();
- while (len > 0) {
- CharBuffer buffer = getBuffer();
- if (buffer == null) {
- return t == 0 ? -1 : t;
- }
- final int rem = Math.min(len, buffer.remaining());
- if (rem > 0) {
- buffer.read(target);
- len -= rem;
- t += rem;
- }
- if (! buffer.hasRemaining()) {
- current = null;
- allocator.free(buffer);
- }
- }
- return t;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean ready() throws IOException {
- final CharBuffer buffer = current;
- return buffer != null && buffer.hasRemaining();
- }
-
- private CharBuffer getBuffer() throws IOException {
- final CharBuffer buffer = current;
- if (buffer == null) {
- while (bufferSource.hasNext()) {
- final CharBuffer newBuffer = bufferSource.next();
- if (newBuffer.hasRemaining()) {
- current = newBuffer;
- return newBuffer;
- } else {
- allocator.free(newBuffer);
- }
- }
- return null;
- } else {
- return buffer;
- }
- }
-}
\ No newline at end of file
Deleted:
remoting3/trunk/api/src/main/java/org/jboss/remoting/stream/CharBufferWriter.java
===================================================================
---
remoting3/trunk/api/src/main/java/org/jboss/remoting/stream/CharBufferWriter.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/api/src/main/java/org/jboss/remoting/stream/CharBufferWriter.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -1,150 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, 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.remoting.stream;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.nio.CharBuffer;
-import org.jboss.xnio.BufferAllocator;
-import org.jboss.xnio.IoUtils;
-import org.jboss.xnio.Buffers;
-
-/**
- * A writer that writes to buffers. Instances of this class are not normally safe to use
from multiple threads
- * concurrently.
- */
-public final class CharBufferWriter extends Writer {
- private final ObjectSink<CharBuffer> bufferSink;
- private final BufferAllocator<CharBuffer> allocator;
-
- private CharBuffer current;
- private boolean closed;
-
- /**
- * Construct a new stream instance.
- *
- * @param bufferSink the buffer sink to which full buffers will be written
- * @param allocator the allocator from which empty buffers will be allocated
- */
- public CharBufferWriter(final ObjectSink<CharBuffer> bufferSink, final
BufferAllocator<CharBuffer> allocator) {
- this.bufferSink = bufferSink;
- this.allocator = allocator;
- }
-
- private CharBuffer getBuffer() throws IOException {
- final CharBuffer buffer = current;
- if (buffer == null) {
- CharBuffer newbuf = allocator.allocate();
- if (newbuf == null) {
- throw new IOException("No buffers available");
- }
- current = newbuf;
- return newbuf;
- } else {
- return buffer;
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void write(final int b) throws IOException {
- if (closed) {
- throw new IOException("Write to closed writer");
- }
- final CharBuffer buffer = getBuffer();
- buffer.put((char)b);
- if (! buffer.hasRemaining()) {
- localFlush();
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void write(final char[] b, int off, int len) throws IOException {
- if (closed) {
- throw new IOException("Write to closed writer");
- }
- do {
- final CharBuffer buffer = getBuffer();
- final int rem = Math.min(len, buffer.remaining());
- buffer.put(b, off, rem);
- if (! buffer.hasRemaining()) {
- localFlush();
- }
- len -= rem; off += rem;
- } while (len > 0);
- }
-
- /**
- * {@inheritDoc}
- */
- public void write(final String str, int off, int len) throws IOException {
- if (closed) {
- throw new IOException("Write to closed writer");
- }
- do {
- final CharBuffer buffer = getBuffer();
- final int rem = Math.min(len, buffer.remaining());
- buffer.put(str, off, off + rem);
- if (! buffer.hasRemaining()) {
- localFlush();
- }
- len -= rem; off += rem;
- } while (len > 0);
- }
-
- /**
- * {@inheritDoc}
- */
- public void flush() throws IOException {
- localFlush();
- bufferSink.flush();
- }
-
- /**
- * {@inheritDoc}
- */
- public void close() throws IOException {
- if (! closed) try {
- flush();
- bufferSink.close();
- } finally {
- closed = true;
- IoUtils.safeClose(bufferSink);
- }
- }
-
- private void localFlush() throws IOException {
- if (closed) {
- throw new IOException("Flush on closed writer");
- }
- final CharBuffer buffer = current;
- if (buffer != null) try {
- bufferSink.accept(Buffers.flip(buffer));
- } finally {
- current = null;
- }
- }
-}
\ No newline at end of file
Modified: remoting3/trunk/api/src/main/resources/META-INF/jboss-classloading.xml
===================================================================
--- remoting3/trunk/api/src/main/resources/META-INF/jboss-classloading.xml 2008-10-23
00:14:24 UTC (rev 4613)
+++ remoting3/trunk/api/src/main/resources/META-INF/jboss-classloading.xml 2008-10-23
00:50:37 UTC (rev 4614)
@@ -4,9 +4,6 @@
<capabilities>
<package name="org.jboss.remoting" version="3.0.0"/>
<package name="org.jboss.remoting.spi"
version="3.0.0"/>
- <package name="org.jboss.remoting.spi.remote"
version="3.0.0"/>
- <package name="org.jboss.remoting.spi.stream"
version="3.0.0"/>
- <package name="org.jboss.remoting.spi.wrapper"
version="3.0.0"/>
<package name="org.jboss.remoting.stream"
version="3.0.0"/>
</capabilities>
<requirements>
Modified: remoting3/trunk/api/src/test/java/org/jboss/remoting/spi/CloseableTestCase.java
===================================================================
---
remoting3/trunk/api/src/test/java/org/jboss/remoting/spi/CloseableTestCase.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/api/src/test/java/org/jboss/remoting/spi/CloseableTestCase.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -31,7 +31,7 @@
import org.jboss.xnio.IoUtils;
import org.jboss.remoting.CloseHandler;
import org.jboss.remoting.test.support.LoggingHelper;
-import org.jboss.remoting.spi.remote.Handle;
+import org.jboss.remoting.spi.Handle;
/**
*
Deleted:
remoting3/trunk/api/src/test/java/org/jboss/remoting/stream/ByteBufferInputStreamTestCase.java
===================================================================
---
remoting3/trunk/api/src/test/java/org/jboss/remoting/stream/ByteBufferInputStreamTestCase.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/api/src/test/java/org/jboss/remoting/stream/ByteBufferInputStreamTestCase.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -1,89 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, 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.remoting.stream;
-
-import junit.framework.TestCase;
-import java.util.Arrays;
-import java.nio.ByteBuffer;
-import org.jboss.remoting.test.support.TestByteBufferAllocator;
-import org.jboss.remoting.test.support.LoggingHelper;
-
-/**
- *
- */
-public final class ByteBufferInputStreamTestCase extends TestCase {
- static {
- LoggingHelper.init();
- }
-
- public void testBasic() throws Throwable {
- final TestByteBufferAllocator allocator = new TestByteBufferAllocator(3);
- final ByteBufferInputStream stream = new
ByteBufferInputStream(Streams.<ByteBuffer>getIteratorObjectSource(Arrays.<ByteBuffer>asList(
- ByteBuffer.wrap(new byte[] { 5, 100, 30, 12, -60, 25 }),
- ByteBuffer.wrap(new byte[] { 15 }),
- ByteBuffer.wrap(new byte[] { }),
- ByteBuffer.wrap(new byte[] { 100, 0, 0, -128, 127, 0 })).iterator()),
allocator);
- assertEquals(5, stream.read());
- assertEquals(100, stream.read());
- assertEquals(30, stream.read());
- assertEquals(12, stream.read());
- assertEquals(-60 & 0xff, stream.read());
- assertEquals(25, stream.read());
- assertEquals(15, stream.read());
- assertEquals(100, stream.read());
- assertEquals(0, stream.read());
- assertEquals(0, stream.read());
- assertEquals(-128 & 0xff, stream.read());
- assertEquals(127, stream.read());
- assertEquals(0, stream.read());
- assertEquals(-1, stream.read());
- assertEquals(-1, stream.read());
- // I fed it four buffers, so there should be -4
- allocator.check(-4);
- }
-
- public void testArrayRead() throws Throwable {
- final TestByteBufferAllocator allocator = new TestByteBufferAllocator(3);
- final ByteBufferInputStream stream = new
ByteBufferInputStream(Streams.<ByteBuffer>getIteratorObjectSource(Arrays.<ByteBuffer>asList(
- ByteBuffer.wrap(new byte[] { 5, 100, 30, 12, -60, 25 }),
- ByteBuffer.wrap(new byte[] { 15 }),
- ByteBuffer.wrap(new byte[] { }),
- ByteBuffer.wrap(new byte[] { 100, 0, 0, -128, 127, 0 })).iterator()),
allocator);
- assertEquals(5, stream.read());
- assertEquals(100, stream.read());
- assertEquals(30, stream.read());
- byte[] bytes = new byte[5];
- assertEquals(5, stream.read(bytes));
- assertTrue(Arrays.equals(new byte[] { 12, -60, 25, 15, 100 }, bytes));
- assertEquals(0, stream.read());
- bytes = new byte[15];
- Arrays.fill(bytes, (byte) 7);
- assertEquals(3, stream.read(bytes, 4, 3));
- assertTrue(Arrays.equals(new byte[] { 7, 7, 7, 7, 0, -128, 127, 7, 7, 7, 7, 7, 7,
7, 7 }, bytes));
- assertEquals(0, stream.read());
- assertEquals(-1, stream.read());
- assertEquals(-1, stream.read());
- // I fed it four buffers, so there should be -4
- allocator.check(-4);
- }
-}
Deleted:
remoting3/trunk/api/src/test/java/org/jboss/remoting/stream/ByteBufferOutputStreamTestCase.java
===================================================================
---
remoting3/trunk/api/src/test/java/org/jboss/remoting/stream/ByteBufferOutputStreamTestCase.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/api/src/test/java/org/jboss/remoting/stream/ByteBufferOutputStreamTestCase.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -1,79 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, 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.remoting.stream;
-
-import junit.framework.TestCase;
-import org.jboss.remoting.test.support.TestByteBufferAllocator;
-import org.jboss.remoting.test.support.LoggingHelper;
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- *
- */
-public final class ByteBufferOutputStreamTestCase extends TestCase {
- static {
- LoggingHelper.init();
- }
-
- public void testBasic() throws Throwable {
- final TestByteBufferAllocator allocator = new TestByteBufferAllocator(4);
- final List<ByteBuffer> list = new ArrayList<ByteBuffer>();
- final ObjectSink<ByteBuffer> sink = Streams.getCollectionObjectSink(list);
- final ByteBufferOutputStream stream = new ByteBufferOutputStream(sink,
allocator);
- stream.write(new byte[] { 6, 1, 5, 2, 4, 3, 2, 4, 1, 5, 0, 6 });
- stream.write(new byte[0]);
- stream.write(new byte[] { 4, 5, 6, 45, -20, 0, 0, 1, 12, 13, 19, 34 }, 3, 7);
- stream.write(new byte[] { 45, -20, 0, 0, 1, 12, 13 }, 4, 0);
- stream.write(0);
- stream.write(10);
- stream.flush();
- stream.close();
- final ByteBufferInputStream inputStream = new
ByteBufferInputStream(Streams.getIteratorObjectSource(list.iterator()), allocator);
- assertEquals(6, inputStream.read());
- assertEquals(1, inputStream.read());
- assertEquals(5, inputStream.read());
- assertEquals(2, inputStream.read());
- assertEquals(4, inputStream.read());
- assertEquals(3, inputStream.read());
- assertEquals(2, inputStream.read());
- assertEquals(4, inputStream.read());
- assertEquals(1, inputStream.read());
- assertEquals(5, inputStream.read());
- assertEquals(0, inputStream.read());
- assertEquals(6, inputStream.read());
- assertEquals(45, inputStream.read());
- assertEquals(-20 & 0xff, inputStream.read());
- assertEquals(0, inputStream.read());
- assertEquals(0, inputStream.read());
- assertEquals(1, inputStream.read());
- assertEquals(12, inputStream.read());
- assertEquals(13, inputStream.read());
- assertEquals(0, inputStream.read());
- assertEquals(10, inputStream.read());
- assertEquals(-1, inputStream.read());
- inputStream.close();
- allocator.check(0);
- }
-}
Deleted:
remoting3/trunk/api/src/test/java/org/jboss/remoting/stream/CharBufferReaderTestCase.java
===================================================================
---
remoting3/trunk/api/src/test/java/org/jboss/remoting/stream/CharBufferReaderTestCase.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/api/src/test/java/org/jboss/remoting/stream/CharBufferReaderTestCase.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -1,57 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, 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.remoting.stream;
-
-import junit.framework.TestCase;
-import org.jboss.remoting.test.support.TestCharBufferAllocator;
-import org.jboss.remoting.test.support.LoggingHelper;
-import java.util.Arrays;
-import java.nio.CharBuffer;
-
-/**
- *
- */
-public final class CharBufferReaderTestCase extends TestCase {
- static {
- LoggingHelper.init();
- }
-
- public void testBasic() throws Throwable {
- final TestCharBufferAllocator allocator = new TestCharBufferAllocator(10);
- final ObjectSource<CharBuffer> source =
Streams.getIteratorObjectSource(Arrays.asList(
- CharBuffer.wrap("The quick brown "),
- CharBuffer.wrap("fox j"),
- CharBuffer.wrap("u"),
- CharBuffer.allocate(0),
- CharBuffer.wrap("mps over the la"),
- CharBuffer.wrap("zy dogs.")
- ).iterator());
- CharBufferReader reader = new CharBufferReader(source, allocator);
- String s = "The quick brown fox jumps over the lazy dogs.";
- for (int i = 0; i < s.length(); i ++) {
- assertEquals(s.charAt(i), reader.read());
- }
- assertEquals(-1, reader.read());
- allocator.check(-6);
- }
-}
Deleted:
remoting3/trunk/api/src/test/java/org/jboss/remoting/stream/CharBufferWriterTestCase.java
===================================================================
---
remoting3/trunk/api/src/test/java/org/jboss/remoting/stream/CharBufferWriterTestCase.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/api/src/test/java/org/jboss/remoting/stream/CharBufferWriterTestCase.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -1,64 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, 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.remoting.stream;
-
-import junit.framework.TestCase;
-import java.util.ArrayList;
-import java.util.List;
-import java.nio.CharBuffer;
-import org.jboss.remoting.test.support.TestCharBufferAllocator;
-import org.jboss.remoting.test.support.LoggingHelper;
-
-/**
- *
- */
-public final class CharBufferWriterTestCase extends TestCase {
- static {
- LoggingHelper.init();
- }
-
- public void testBasic() throws Throwable {
- final TestCharBufferAllocator allocator = new TestCharBufferAllocator(7);
- final List<CharBuffer> list = new ArrayList<CharBuffer>();
- final ObjectSink<CharBuffer> sink = Streams.getCollectionObjectSink(list);
- final CharBufferWriter writer = new CharBufferWriter(sink, allocator);
- writer.append("Th");
- writer.append("blah e qui blah", 5, 10);
- writer.append('c');
- writer.write('k');
- writer.write(new char[] { ' ', 'b', 'r' });
- writer.write(new char[] { 'x', 'x', 'o', 'w',
'n', ' ', 'x' }, 2, 4);
- writer.write("fox jumps");
- writer.write("blah over the lazy dogs. blah", 4, 20);
- writer.flush();
- writer.close();
- final ObjectSource<CharBuffer> source =
Streams.getIteratorObjectSource(list.iterator());
- CharBufferReader reader = new CharBufferReader(source, allocator);
- String s = "The quick brown fox jumps over the lazy dogs.";
- for (int i = 0; i < s.length(); i ++) {
- assertEquals("position = " + i, (char)s.charAt(i),
(char)reader.read());
- }
- assertEquals(-1, reader.read());
- allocator.check(0);
- }
-}
Modified:
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/ClientExternalizer.java
===================================================================
---
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/ClientExternalizer.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/ClientExternalizer.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -24,7 +24,7 @@
import org.jboss.marshalling.Externalizer;
import org.jboss.marshalling.Creator;
-import org.jboss.remoting.spi.remote.RequestHandler;
+import org.jboss.remoting.spi.RequestHandler;
import java.io.ObjectOutput;
import java.io.IOException;
import java.io.ObjectInput;
Modified: remoting3/trunk/core/src/main/java/org/jboss/remoting/core/ClientImpl.java
===================================================================
--- remoting3/trunk/core/src/main/java/org/jboss/remoting/core/ClientImpl.java 2008-10-23
00:14:24 UTC (rev 4613)
+++ remoting3/trunk/core/src/main/java/org/jboss/remoting/core/ClientImpl.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -25,10 +25,10 @@
import org.jboss.remoting.Client;
import org.jboss.remoting.IndeterminateOutcomeException;
import org.jboss.remoting.core.util.QueueExecutor;
-import org.jboss.remoting.spi.remote.RequestHandler;
-import org.jboss.remoting.spi.remote.ReplyHandler;
-import org.jboss.remoting.spi.remote.RemoteRequestContext;
-import org.jboss.remoting.spi.remote.Handle;
+import org.jboss.remoting.spi.RequestHandler;
+import org.jboss.remoting.spi.ReplyHandler;
+import org.jboss.remoting.spi.RemoteRequestContext;
+import org.jboss.remoting.spi.Handle;
import org.jboss.xnio.IoFuture;
import java.util.concurrent.Executor;
import java.io.IOException;
Modified:
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/ClientSourceExternalizer.java
===================================================================
---
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/ClientSourceExternalizer.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/ClientSourceExternalizer.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -27,7 +27,7 @@
import java.io.ObjectOutput;
import org.jboss.marshalling.Creator;
import org.jboss.marshalling.Externalizer;
-import org.jboss.remoting.spi.remote.RequestHandlerSource;
+import org.jboss.remoting.spi.RequestHandlerSource;
/**
*
Modified:
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/ClientSourceImpl.java
===================================================================
---
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/ClientSourceImpl.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/ClientSourceImpl.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -25,9 +25,9 @@
import org.jboss.remoting.ClientSource;
import org.jboss.remoting.Client;
import org.jboss.remoting.Endpoint;
-import org.jboss.remoting.spi.remote.RequestHandler;
-import org.jboss.remoting.spi.remote.RequestHandlerSource;
-import org.jboss.remoting.spi.remote.Handle;
+import org.jboss.remoting.spi.RequestHandler;
+import org.jboss.remoting.spi.RequestHandlerSource;
+import org.jboss.remoting.spi.Handle;
import org.jboss.remoting.spi.AbstractHandleableCloseable;
import org.jboss.xnio.IoUtils;
import java.io.IOException;
Modified: remoting3/trunk/core/src/main/java/org/jboss/remoting/core/EndpointImpl.java
===================================================================
---
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/EndpointImpl.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/EndpointImpl.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -19,9 +19,9 @@
import org.jboss.remoting.SimpleCloseable;
import org.jboss.remoting.ServiceListener;
import org.jboss.remoting.util.OrderedExecutorFactory;
-import org.jboss.remoting.spi.remote.RequestHandler;
-import org.jboss.remoting.spi.remote.RequestHandlerSource;
-import org.jboss.remoting.spi.remote.Handle;
+import org.jboss.remoting.spi.RequestHandler;
+import org.jboss.remoting.spi.RequestHandlerSource;
+import org.jboss.remoting.spi.Handle;
import org.jboss.remoting.spi.AbstractSimpleCloseable;
import org.jboss.remoting.util.CollectionUtil;
import org.jboss.remoting.util.NamingThreadFactory;
Modified: remoting3/trunk/core/src/main/java/org/jboss/remoting/core/FutureReplyImpl.java
===================================================================
---
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/FutureReplyImpl.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/FutureReplyImpl.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -22,8 +22,8 @@
package org.jboss.remoting.core;
-import org.jboss.remoting.spi.remote.ReplyHandler;
-import org.jboss.remoting.spi.remote.RemoteRequestContext;
+import org.jboss.remoting.spi.ReplyHandler;
+import org.jboss.remoting.spi.RemoteRequestContext;
import org.jboss.xnio.AbstractIoFuture;
import org.jboss.xnio.IoFuture;
import java.util.concurrent.Executor;
Modified:
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/LocalRequestHandler.java
===================================================================
---
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/LocalRequestHandler.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/LocalRequestHandler.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -22,9 +22,9 @@
package org.jboss.remoting.core;
-import org.jboss.remoting.spi.remote.RequestHandler;
-import org.jboss.remoting.spi.remote.RemoteRequestContext;
-import org.jboss.remoting.spi.remote.ReplyHandler;
+import org.jboss.remoting.spi.RequestHandler;
+import org.jboss.remoting.spi.RemoteRequestContext;
+import org.jboss.remoting.spi.ReplyHandler;
import org.jboss.remoting.spi.SpiUtils;
import org.jboss.remoting.spi.AbstractAutoCloseable;
import org.jboss.remoting.RequestListener;
Modified:
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/LocalRequestHandlerSource.java
===================================================================
---
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/LocalRequestHandlerSource.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/LocalRequestHandlerSource.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -22,9 +22,9 @@
package org.jboss.remoting.core;
-import org.jboss.remoting.spi.remote.RequestHandlerSource;
-import org.jboss.remoting.spi.remote.RequestHandler;
-import org.jboss.remoting.spi.remote.Handle;
+import org.jboss.remoting.spi.RequestHandlerSource;
+import org.jboss.remoting.spi.RequestHandler;
+import org.jboss.remoting.spi.Handle;
import org.jboss.remoting.spi.AbstractAutoCloseable;
import org.jboss.remoting.RequestListener;
import org.jboss.remoting.CloseHandler;
Modified:
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/RequestContextImpl.java
===================================================================
---
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/RequestContextImpl.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/RequestContextImpl.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -28,7 +28,7 @@
import org.jboss.remoting.RemoteExecutionException;
import org.jboss.remoting.RemoteReplyException;
import org.jboss.remoting.IndeterminateOutcomeException;
-import org.jboss.remoting.spi.remote.ReplyHandler;
+import org.jboss.remoting.spi.ReplyHandler;
import org.jboss.remoting.spi.SpiUtils;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
Modified:
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/ServiceRegistration.java
===================================================================
---
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/ServiceRegistration.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/ServiceRegistration.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -22,7 +22,7 @@
package org.jboss.remoting.core;
-import org.jboss.remoting.spi.remote.RequestHandlerSource;
+import org.jboss.remoting.spi.RequestHandlerSource;
import org.jboss.remoting.SimpleCloseable;
/**
Modified:
remoting3/trunk/core/src/test/java/org/jboss/remoting/core/EndpointTestCase.java
===================================================================
---
remoting3/trunk/core/src/test/java/org/jboss/remoting/core/EndpointTestCase.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/core/src/test/java/org/jboss/remoting/core/EndpointTestCase.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -34,8 +34,8 @@
import org.jboss.remoting.CloseHandler;
import org.jboss.remoting.Client;
import org.jboss.remoting.test.support.LoggingHelper;
-import org.jboss.remoting.spi.remote.RequestHandler;
-import org.jboss.remoting.spi.remote.Handle;
+import org.jboss.remoting.spi.RequestHandler;
+import org.jboss.remoting.spi.Handle;
import org.jboss.xnio.IoUtils;
/**
Modified:
remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/BasicConfiguration.java
===================================================================
---
remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/BasicConfiguration.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/BasicConfiguration.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -25,7 +25,6 @@
import org.jboss.marshalling.MarshallerFactory;
import org.jboss.marshalling.Configuration;
import org.jboss.xnio.BufferAllocator;
-import org.jboss.remoting.spi.stream.StreamDetector;
import java.util.concurrent.Executor;
import java.nio.ByteBuffer;
@@ -38,7 +37,6 @@
private int linkMetric;
private Executor executor;
private BufferAllocator<ByteBuffer> allocator;
- private StreamDetector streamDetector;
public MarshallerFactory getMarshallerFactory() {
return marshallerFactory;
@@ -79,12 +77,4 @@
public void setAllocator(final BufferAllocator<ByteBuffer> allocator) {
this.allocator = allocator;
}
-
- public StreamDetector getStreamDetector() {
- return streamDetector;
- }
-
- public void setStreamDetector(final StreamDetector streamDetector) {
- this.streamDetector = streamDetector;
- }
}
Modified:
remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/BasicHandlerReplyConsumer.java
===================================================================
---
remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/BasicHandlerReplyConsumer.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/BasicHandlerReplyConsumer.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -30,7 +30,7 @@
import org.jboss.xnio.channels.StreamChannel;
import org.jboss.xnio.IoUtils;
import org.jboss.xnio.log.Logger;
-import org.jboss.remoting.spi.remote.ReplyHandler;
+import org.jboss.remoting.spi.ReplyHandler;
import org.jboss.remoting.spi.SpiUtils;
import org.jboss.remoting.RemoteExecutionException;
import org.jboss.remoting.ReplyException;
Modified:
remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/BasicProtocol.java
===================================================================
---
remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/BasicProtocol.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/BasicProtocol.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -22,9 +22,9 @@
package org.jboss.remoting.protocol.basic;
-import org.jboss.remoting.spi.remote.RequestHandler;
-import org.jboss.remoting.spi.remote.ReplyHandler;
-import org.jboss.remoting.spi.remote.Handle;
+import org.jboss.remoting.spi.RequestHandler;
+import org.jboss.remoting.spi.ReplyHandler;
+import org.jboss.remoting.spi.Handle;
import org.jboss.xnio.channels.StreamChannel;
import org.jboss.xnio.channels.ChannelOutputStream;
import org.jboss.xnio.channels.ChannelInputStream;
Modified:
remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/BasicRequestHandler.java
===================================================================
---
remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/BasicRequestHandler.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/BasicRequestHandler.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -22,9 +22,9 @@
package org.jboss.remoting.protocol.basic;
-import org.jboss.remoting.spi.remote.RequestHandler;
-import org.jboss.remoting.spi.remote.ReplyHandler;
-import org.jboss.remoting.spi.remote.RemoteRequestContext;
+import org.jboss.remoting.spi.RequestHandler;
+import org.jboss.remoting.spi.ReplyHandler;
+import org.jboss.remoting.spi.RemoteRequestContext;
import org.jboss.remoting.spi.SpiUtils;
import org.jboss.remoting.spi.AbstractAutoCloseable;
import org.jboss.marshalling.Marshaller;
Modified:
remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/BasicServerReplyTransmitter.java
===================================================================
---
remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/BasicServerReplyTransmitter.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/BasicServerReplyTransmitter.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -27,8 +27,8 @@
import org.jboss.xnio.channels.StreamChannel;
import org.jboss.xnio.IoUtils;
import org.jboss.xnio.log.Logger;
-import org.jboss.remoting.spi.remote.RequestHandler;
-import org.jboss.remoting.spi.remote.Handle;
+import org.jboss.remoting.spi.RequestHandler;
+import org.jboss.remoting.spi.Handle;
/**
*
Modified:
remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/BasicServerRequestConsumer.java
===================================================================
---
remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/BasicServerRequestConsumer.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/BasicServerRequestConsumer.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -23,10 +23,10 @@
package org.jboss.remoting.protocol.basic;
import org.jboss.marshalling.Unmarshaller;
-import org.jboss.remoting.spi.remote.RequestHandler;
-import org.jboss.remoting.spi.remote.Handle;
-import org.jboss.remoting.spi.remote.RemoteRequestContext;
-import org.jboss.remoting.spi.remote.ReplyHandler;
+import org.jboss.remoting.spi.RequestHandler;
+import org.jboss.remoting.spi.Handle;
+import org.jboss.remoting.spi.RemoteRequestContext;
+import org.jboss.remoting.spi.ReplyHandler;
import org.jboss.xnio.channels.StreamChannel;
import org.jboss.xnio.IoUtils;
import org.jboss.xnio.log.Logger;
Modified:
remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/FutureBasicReply.java
===================================================================
---
remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/FutureBasicReply.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/FutureBasicReply.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -24,7 +24,7 @@
import org.jboss.xnio.AbstractIoFuture;
import org.jboss.xnio.IoFuture;
-import org.jboss.remoting.spi.remote.RemoteRequestContext;
+import org.jboss.remoting.spi.RemoteRequestContext;
import java.io.IOException;
/**
Modified:
remoting3/trunk/protocol/basic/src/test/java/org/jboss/remoting/protocol/basic/BasicTestCase.java
===================================================================
---
remoting3/trunk/protocol/basic/src/test/java/org/jboss/remoting/protocol/basic/BasicTestCase.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/protocol/basic/src/test/java/org/jboss/remoting/protocol/basic/BasicTestCase.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -38,10 +38,9 @@
import org.jboss.remoting.RemoteExecutionException;
import org.jboss.remoting.Client;
import org.jboss.remoting.test.support.LoggingHelper;
-import org.jboss.remoting.spi.remote.RequestHandler;
-import org.jboss.remoting.spi.remote.Handle;
+import org.jboss.remoting.spi.RequestHandler;
+import org.jboss.remoting.spi.Handle;
import org.jboss.marshalling.Configuration;
-import java.util.concurrent.Executor;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.LinkedBlockingQueue;
Modified:
remoting3/trunk/protocol/multiplex/src/main/java/org/jboss/remoting/protocol/multiplex/MultiplexHandler.java
===================================================================
---
remoting3/trunk/protocol/multiplex/src/main/java/org/jboss/remoting/protocol/multiplex/MultiplexHandler.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/protocol/multiplex/src/main/java/org/jboss/remoting/protocol/multiplex/MultiplexHandler.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -23,24 +23,17 @@
package org.jboss.remoting.protocol.multiplex;
import org.jboss.xnio.channels.AllocatedMessageChannel;
-import org.jboss.xnio.channels.StreamChannel;
import org.jboss.xnio.IoHandler;
import org.jboss.xnio.BufferAllocator;
import org.jboss.xnio.IoUtils;
-import org.jboss.xnio.IoFuture;
-import org.jboss.xnio.Connector;
-import org.jboss.xnio.Acceptor;
import org.jboss.xnio.log.Logger;
-import org.jboss.remoting.spi.remote.RequestHandler;
-import org.jboss.remoting.spi.remote.RequestHandlerSource;
-import org.jboss.remoting.spi.remote.ReplyHandler;
-import org.jboss.remoting.spi.remote.RemoteRequestContext;
-import org.jboss.remoting.spi.remote.Handle;
+import org.jboss.remoting.spi.RequestHandler;
+import org.jboss.remoting.spi.RequestHandlerSource;
+import org.jboss.remoting.spi.ReplyHandler;
+import org.jboss.remoting.spi.RemoteRequestContext;
+import org.jboss.remoting.spi.Handle;
import org.jboss.remoting.spi.SpiUtils;
import org.jboss.remoting.spi.AbstractAutoCloseable;
-import org.jboss.remoting.spi.stream.StreamDetector;
-import org.jboss.remoting.spi.stream.StreamSerializerFactory;
-import org.jboss.remoting.spi.stream.StreamProvider;
import static org.jboss.remoting.util.CollectionUtil.concurrentIntegerMap;
import org.jboss.remoting.util.CollectionUtil;
import org.jboss.remoting.util.ConcurrentIntegerMap;
@@ -84,11 +77,6 @@
private final Executor executor;
// buffer allocator for outbound message assembly
private final BufferAllocator<ByteBuffer> allocator;
- private final StreamDetector streamDetector;
- private final Connector<A, AllocatedMessageChannel> messageConnector;
- private final Acceptor<A, AllocatedMessageChannel> messageAcceptor;
- private final Connector<A, StreamChannel> streamConnector;
- private final Acceptor<A, StreamChannel> streamAcceptor;
// running on remote node
private final ConcurrentIntegerMap<ReplyHandler> remoteRequests =
concurrentIntegerMap();
@@ -119,18 +107,13 @@
private volatile AllocatedMessageChannel channel;
- public MultiplexHandler(final Endpoint endpoint, final RemotingChannelConfiguration
configuration, final StreamProvider<A> streamProvider) {
+ public MultiplexHandler(final Endpoint endpoint, final RemotingChannelConfiguration
configuration) {
this.endpoint = endpoint;
- messageConnector = streamProvider.getMessageChannelConnector();
- messageAcceptor = streamProvider.getMessageChannelAcceptor();
- streamConnector = streamProvider.getStreamChannelConnector();
- streamAcceptor = streamProvider.getStreamChannelAcceptor();
allocator = configuration.getAllocator();
executor = configuration.getExecutor();
marshallerFactory = configuration.getMarshallerFactory();
marshallingConfiguration = configuration.getMarshallingConfiguration();
linkMetric = configuration.getLinkMetric();
- streamDetector = configuration.getStreamDetector();
}
public void handleOpened(final AllocatedMessageChannel channel) {
@@ -805,13 +788,6 @@
final RequestHandlerSource requestHandlerSource = (RequestHandlerSource)
o;
} else {
- final StreamSerializerFactory ssf = streamDetector.detectStream(o);
- if (ssf != null) {
- final IoHandler<? super AllocatedMessageChannel> streamHandler
= ssf.getLocalSide(o, new StreamContextImpl(executor, marshallerFactory,
marshallingConfiguration));
- // todo - this should really be the "server" side
- final IoFuture<AllocatedMessageChannel> futureChannel =
messageConnector.connectTo(null, streamHandler);
-
- }
}
return null;
}
Modified:
remoting3/trunk/protocol/multiplex/src/main/java/org/jboss/remoting/protocol/multiplex/MultiplexProtocol.java
===================================================================
---
remoting3/trunk/protocol/multiplex/src/main/java/org/jboss/remoting/protocol/multiplex/MultiplexProtocol.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/protocol/multiplex/src/main/java/org/jboss/remoting/protocol/multiplex/MultiplexProtocol.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -25,9 +25,8 @@
import org.jboss.remoting.RemotingException;
import org.jboss.remoting.SimpleCloseable;
import org.jboss.remoting.Endpoint;
-import org.jboss.remoting.spi.remote.RequestHandlerSource;
-import org.jboss.remoting.spi.remote.Handle;
-import org.jboss.remoting.spi.stream.StreamProvider;
+import org.jboss.remoting.spi.RequestHandlerSource;
+import org.jboss.remoting.spi.Handle;
import org.jboss.xnio.IoHandlerFactory;
import org.jboss.xnio.ChannelSource;
import org.jboss.xnio.IoFuture;
@@ -53,19 +52,17 @@
/**
* Create a request server for the multiplex protocol.
*
- * @param executor the executor to use for invocations
+ * @return a handler factory for passing to an XNIO server @param executor the
executor to use for invocations
* @param allocator the buffer allocator to use
- * @return a handler factory for passing to an XNIO server
- * @param <A> stream channel address type
*/
- public static <A> IoHandlerFactory<AllocatedMessageChannel>
createServer(final Endpoint endpoint, final Executor executor, final
BufferAllocator<ByteBuffer> allocator, final StreamProvider<A> streamProvider)
{
+ public static <A> IoHandlerFactory<AllocatedMessageChannel>
createServer(final Endpoint endpoint, final Executor executor, final
BufferAllocator<ByteBuffer> allocator) {
return new IoHandlerFactory<AllocatedMessageChannel>() {
public IoHandler<? super AllocatedMessageChannel> createHandler() {
final RemotingChannelConfiguration configuration = new
RemotingChannelConfiguration();
configuration.setAllocator(allocator);
configuration.setExecutor(executor);
// todo marshaller factory... etc
- return new MultiplexHandler<A>(endpoint, configuration,
streamProvider);
+ return new MultiplexHandler<A>(endpoint, configuration);
}
};
}
@@ -74,17 +71,15 @@
* Create a request client for the multiplex protocol.
*
* @return a handle which may be used to close the connection
- * @throws IOException if an error occurs @param executor the executor to use for
invocations
- * @param channelSource the XNIO channel source to use to establish the connection
+ * @throws IOException if an error occurs @param executor the executor to use for
invocations @param channelSource the XNIO channel source to use to establish the
connection
* @param allocator the buffer allocator to use
- * @param streamProvider
*/
- public static <A> IoFuture<SimpleCloseable> connect(final Endpoint
endpoint, final Executor executor, final ChannelSource<AllocatedMessageChannel>
channelSource, final BufferAllocator<ByteBuffer> allocator, final
StreamProvider<A> streamProvider) throws IOException {
+ public static <A> IoFuture<SimpleCloseable> connect(final Endpoint
endpoint, final Executor executor, final ChannelSource<AllocatedMessageChannel>
channelSource, final BufferAllocator<ByteBuffer> allocator) throws IOException {
final RemotingChannelConfiguration configuration = new
RemotingChannelConfiguration();
configuration.setAllocator(allocator);
configuration.setExecutor(executor);
// todo marshaller factory... etc
- final MultiplexHandler<A> multiplexHandler = new
MultiplexHandler<A>(endpoint, configuration, streamProvider);
+ final MultiplexHandler<A> multiplexHandler = new
MultiplexHandler<A>(endpoint, configuration);
final IoFuture<AllocatedMessageChannel> futureChannel =
channelSource.open(multiplexHandler);
return new AbstractConvertingIoFuture<SimpleCloseable,
AllocatedMessageChannel>(futureChannel) {
protected SimpleCloseable convert(final AllocatedMessageChannel channel)
throws RemotingException {
Modified:
remoting3/trunk/protocol/multiplex/src/main/java/org/jboss/remoting/protocol/multiplex/RemotingChannelConfiguration.java
===================================================================
---
remoting3/trunk/protocol/multiplex/src/main/java/org/jboss/remoting/protocol/multiplex/RemotingChannelConfiguration.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/protocol/multiplex/src/main/java/org/jboss/remoting/protocol/multiplex/RemotingChannelConfiguration.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -27,7 +27,6 @@
import org.jboss.xnio.BufferAllocator;
import org.jboss.marshalling.MarshallerFactory;
import org.jboss.marshalling.Configuration;
-import org.jboss.remoting.spi.stream.StreamDetector;
/**
*
@@ -38,7 +37,6 @@
private int linkMetric;
private Executor executor;
private BufferAllocator<ByteBuffer> allocator;
- private StreamDetector streamDetector;
public RemotingChannelConfiguration() {
}
@@ -82,12 +80,4 @@
public void setAllocator(final BufferAllocator<ByteBuffer> allocator) {
this.allocator = allocator;
}
-
- public StreamDetector getStreamDetector() {
- return streamDetector;
- }
-
- public void setStreamDetector(final StreamDetector streamDetector) {
- this.streamDetector = streamDetector;
- }
}
Deleted:
remoting3/trunk/protocol/multiplex/src/main/java/org/jboss/remoting/protocol/multiplex/StreamContextImpl.java
===================================================================
---
remoting3/trunk/protocol/multiplex/src/main/java/org/jboss/remoting/protocol/multiplex/StreamContextImpl.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/protocol/multiplex/src/main/java/org/jboss/remoting/protocol/multiplex/StreamContextImpl.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -1,59 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, 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.remoting.protocol.multiplex;
-
-import org.jboss.remoting.spi.stream.StreamContext;
-import org.jboss.marshalling.Marshaller;
-import org.jboss.marshalling.Unmarshaller;
-import org.jboss.marshalling.Configuration;
-import org.jboss.marshalling.MarshallerFactory;
-import java.util.concurrent.Executor;
-import java.io.IOException;
-
-/**
- *
- */
-public final class StreamContextImpl implements StreamContext {
-
- private final Executor executor;
- private final MarshallerFactory marshallerFactory;
- private final Configuration marshallerConfiguration;
-
- StreamContextImpl(final Executor executor, final MarshallerFactory marshallerFactory,
final Configuration marshallerConfiguration) {
- this.executor = executor;
- this.marshallerFactory = marshallerFactory;
- this.marshallerConfiguration = marshallerConfiguration;
- }
-
- public Executor getExecutor() {
- return executor;
- }
-
- public Marshaller createMarshaller() throws IOException {
- return marshallerFactory.createMarshaller(marshallerConfiguration);
- }
-
- public Unmarshaller createUnmarshaller() throws IOException {
- return marshallerFactory.createUnmarshaller(marshallerConfiguration);
- }
-}
Modified: remoting3/trunk/standalone/src/main/java/org/jboss/remoting/Remoting.java
===================================================================
--- remoting3/trunk/standalone/src/main/java/org/jboss/remoting/Remoting.java 2008-10-23
00:14:24 UTC (rev 4613)
+++ remoting3/trunk/standalone/src/main/java/org/jboss/remoting/Remoting.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -2,9 +2,9 @@
import java.io.IOException;
import org.jboss.remoting.core.EndpointImpl;
-import org.jboss.remoting.spi.remote.RequestHandler;
-import org.jboss.remoting.spi.remote.RequestHandlerSource;
-import org.jboss.remoting.spi.remote.Handle;
+import org.jboss.remoting.spi.RequestHandler;
+import org.jboss.remoting.spi.RequestHandlerSource;
+import org.jboss.remoting.spi.Handle;
import org.jboss.xnio.IoUtils;
/**
Modified:
remoting3/trunk/transporter/src/main/java/org/jboss/remoting/transporter/Transporter.java
===================================================================
---
remoting3/trunk/transporter/src/main/java/org/jboss/remoting/transporter/Transporter.java 2008-10-23
00:14:24 UTC (rev 4613)
+++
remoting3/trunk/transporter/src/main/java/org/jboss/remoting/transporter/Transporter.java 2008-10-23
00:50:37 UTC (rev 4614)
@@ -24,8 +24,8 @@
import org.jboss.remoting.Endpoint;
import org.jboss.remoting.Client;
-import org.jboss.remoting.spi.remote.RequestHandler;
-import org.jboss.remoting.spi.remote.Handle;
+import org.jboss.remoting.spi.RequestHandler;
+import org.jboss.remoting.spi.Handle;
import org.jboss.xnio.IoUtils;
import java.io.IOException;
import java.lang.reflect.Proxy;