You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2004/11/02 20:28:28 UTC
svn commit: rev 56404 - incubator/directory/seda/trunk/src/java/org/apache/seda/protocol
Author: akarasulu
Date: Tue Nov 2 11:28:27 2004
New Revision: 56404
Added:
incubator/directory/seda/trunk/src/java/org/apache/seda/protocol/AbstractManyReplyHandler.java
incubator/directory/seda/trunk/src/java/org/apache/seda/protocol/AbstractNoReplyHandler.java
incubator/directory/seda/trunk/src/java/org/apache/seda/protocol/AbstractRequestHandler.java
incubator/directory/seda/trunk/src/java/org/apache/seda/protocol/AbstractSingleReplyHandler.java
Modified:
incubator/directory/seda/trunk/src/java/org/apache/seda/protocol/ProtocolProvider.java
Log:
added some abstract convenience classes for request handlers
Added: incubator/directory/seda/trunk/src/java/org/apache/seda/protocol/AbstractManyReplyHandler.java
==============================================================================
--- (empty file)
+++ incubator/directory/seda/trunk/src/java/org/apache/seda/protocol/AbstractManyReplyHandler.java Tue Nov 2 11:28:27 2004
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.seda.protocol;
+
+
+/**
+ * An abstract ManyReplyHandler convenience class.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public abstract class AbstractManyReplyHandler extends AbstractRequestHandler implements ManyReplyHandler
+{
+ /** whether or not this handler requires sequential returns of responses */
+ private final boolean isSequential;
+
+
+ /**
+ * Creates a ManyReplyHandler.
+ *
+ * @param isSequential true if responses must be returned sequentially,
+ * false of the order of return is not significant.
+ */
+ public AbstractManyReplyHandler( boolean isSequential )
+ {
+ super( HandlerTypeEnum.MANYREPLY );
+
+ this.isSequential = isSequential;
+ }
+
+
+ /**
+ * @see ManyReplyHandler#isSequential()
+ */
+ public boolean isSequential()
+ {
+ return this.isSequential;
+ }
+}
Added: incubator/directory/seda/trunk/src/java/org/apache/seda/protocol/AbstractNoReplyHandler.java
==============================================================================
--- (empty file)
+++ incubator/directory/seda/trunk/src/java/org/apache/seda/protocol/AbstractNoReplyHandler.java Tue Nov 2 11:28:27 2004
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.seda.protocol;
+
+
+/**
+ * An abstract convenience class for a NoReplyHandler.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public abstract class AbstractNoReplyHandler extends AbstractRequestHandler implements NoReplyHandler
+{
+ /**
+ * Creates a NoReplyHandler with type {@link HandlerTypeEnum#NOREPLY}.
+ */
+ public AbstractNoReplyHandler()
+ {
+ super( HandlerTypeEnum.NOREPLY );
+ }
+}
Added: incubator/directory/seda/trunk/src/java/org/apache/seda/protocol/AbstractRequestHandler.java
==============================================================================
--- (empty file)
+++ incubator/directory/seda/trunk/src/java/org/apache/seda/protocol/AbstractRequestHandler.java Tue Nov 2 11:28:27 2004
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.seda.protocol;
+
+
+/**
+ * An abstract request handler convenience class.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public abstract class AbstractRequestHandler implements RequestHandler
+{
+ /** the handler type */
+ private final HandlerTypeEnum type;
+
+
+ /**
+ * Sets the type for this handler.
+ *
+ * @param type the handler type
+ */
+ public AbstractRequestHandler( HandlerTypeEnum type )
+ {
+ this.type = type;
+ }
+
+
+ /**
+ * @see RequestHandler#getHandlerType()
+ */
+ public HandlerTypeEnum getHandlerType()
+ {
+ return this.type;
+ }
+}
Added: incubator/directory/seda/trunk/src/java/org/apache/seda/protocol/AbstractSingleReplyHandler.java
==============================================================================
--- (empty file)
+++ incubator/directory/seda/trunk/src/java/org/apache/seda/protocol/AbstractSingleReplyHandler.java Tue Nov 2 11:28:27 2004
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.seda.protocol;
+
+
+/**
+ * An abstract convenience class for a SingleReplyHandler.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public abstract class AbstractSingleReplyHandler extends AbstractRequestHandler implements SingleReplyHandler
+{
+ /**
+ * Creates a SingleReplyHandler with type {@link HandlerTypeEnum#SINGLEREPLY}.
+ */
+ public AbstractSingleReplyHandler()
+ {
+ super( HandlerTypeEnum.SINGLEREPLY );
+ }
+}
Modified: incubator/directory/seda/trunk/src/java/org/apache/seda/protocol/ProtocolProvider.java
==============================================================================
--- incubator/directory/seda/trunk/src/java/org/apache/seda/protocol/ProtocolProvider.java (original)
+++ incubator/directory/seda/trunk/src/java/org/apache/seda/protocol/ProtocolProvider.java Tue Nov 2 11:28:27 2004
@@ -14,7 +14,6 @@
* limitations under the License.
*
*/
-
package org.apache.seda.protocol;
import org.apache.commons.codec.stateful.DecoderFactory;