bloritsch 2002/08/21 17:25:35
Modified: infomover/src/java/org/apache/infomover/connection
ConnectionDescriptor.java ConnectionManager.java
infomover/src/java/org/apache/infomover/jobmanager/impl
JobManagerImpl.java
Added: infomover/src/java/org/apache/infomover/connection
ConnectionListenerFactory.java
Log:
Initial skeleton of implementing the new ConnectionManager
Revision Changes Path
1.2 +39 -6
jakarta-avalon-apps/infomover/src/java/org/apache/infomover/connection/ConnectionDescriptor.java
Index: ConnectionDescriptor.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-apps/infomover/src/java/org/apache/infomover/connection/ConnectionDescriptor.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ConnectionDescriptor.java 21 Aug 2002 20:58:58 -0000 1.1
+++ ConnectionDescriptor.java 22 Aug 2002 00:25:34 -0000 1.2
@@ -49,6 +49,8 @@
*/
package org.apache.infomover.connection;
+import java.net.InetAddress;
+
/**
* The <code>ConnectionManager</code> interface exposes how we control the
* ConnectionManager externally.
@@ -56,15 +58,36 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
* @version 1.0
*/
-public class ConnectionDescriptor
+public final class ConnectionDescriptor
{
+ private final boolean m_isSecure;
private final int m_port;
- private final ConnectionListener m_listener;
+ private final int m_backlog;
+ private final InetAddress m_bind;
+ private final ConnectionListenerFactory m_factory;
+
+ public ConnectionDescriptor( boolean isSecure, int port,
ConnectionListenerFactory factory )
+ {
+ this( isSecure, port, 0, factory );
+ }
- public ConnectionDescriptor( int port, ConnectionListener listener )
+ public ConnectionDescriptor( boolean isSecure, int port, int backlog,
ConnectionListenerFactory factory )
{
+ this( isSecure, port, backlog, null, factory );
+ }
+
+ public ConnectionDescriptor( boolean isSecture, int port, int backlog,
InetAddress bind, ConnectionListenerFactory factory )
+ {
+ m_isSecure = isSecture;
m_port = port;
- m_listener = listener;
+ m_backlog = backlog;
+ m_bind = bind;
+ m_factory = factory;
+ }
+
+ public boolean isSecure()
+ {
+ return m_isSecure;
}
public int getPort()
@@ -72,8 +95,18 @@
return m_port;
}
- public ConnectionListener getListener()
+ public int getBacklog()
+ {
+ return m_backlog;
+ }
+
+ public InetAddress getBindAddress()
+ {
+ return m_bind;
+ }
+
+ public ConnectionListenerFactory getListener()
{
- return m_listener;
+ return m_factory;
}
}
1.2 +7 -2
jakarta-avalon-apps/infomover/src/java/org/apache/infomover/connection/ConnectionManager.java
Index: ConnectionManager.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-apps/infomover/src/java/org/apache/infomover/connection/ConnectionManager.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ConnectionManager.java 21 Aug 2002 20:58:58 -0000 1.1
+++ ConnectionManager.java 22 Aug 2002 00:25:34 -0000 1.2
@@ -63,10 +63,15 @@
/**
* Registers a connection with a name.
*/
- void registerConnection( String name, ConnectionDescriptor descriptor );
+ void connect( String name, ConnectionDescriptor descriptor ) throws Exception;
/**
* Unregisters a connection associated with the name.
*/
- void unregisterConnection( String name );
+ void disconnect( String name );
+
+ /**
+ * Unregisters a connection associated with the name.
+ */
+ void disconnect( String name, boolean force );
}
1.1
jakarta-avalon-apps/infomover/src/java/org/apache/infomover/connection/ConnectionListenerFactory.java
Index: ConnectionListenerFactory.java
===================================================================
/*
============================================================================
The Apache Software License, Version 1.1
============================================================================
Copyright (C) @year@ The Apache Software Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without modifica-
tion, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. The end-user documentation included with the redistribution, if any, must
include the following acknowledgment: "This product includes software
developed by the Apache Software Foundation (http://www.apache.org/)."
Alternately, this acknowledgment may appear in the software itself, if
and wherever such third-party acknowledgments normally appear.
4. The names "Jakarta", "Avalon", "Excalibur" and "Apache Software Foundation"
must not be used to endorse or promote products derived from this software
without prior written permission. For written permission, please contact
[EMAIL PROTECTED]
5. Products derived from this software may not be called "Apache", nor may
"Apache" appear in their name, without prior written permission of the
Apache Software Foundation.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This software consists of voluntary contributions made by many individuals
on behalf of the Apache Software Foundation. For more information on the
Apache Software Foundation, please see <http://www.apache.org/>.
*/
package org.apache.infomover.connection;
/**
* The <code>ConnectionManager</code> interface exposes how we control the
* ConnectionManager externally.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
* @version 1.0
*/
public interface ConnectionListenerFactory
{
public ConnectionListener createConnectionHandler()
throws java.lang.Exception;
public void releaseConnectionHandler(ConnectionListener connectionHandler);
}
1.6 +1 -2
jakarta-avalon-apps/infomover/src/java/org/apache/infomover/jobmanager/impl/JobManagerImpl.java
Index: JobManagerImpl.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-apps/infomover/src/java/org/apache/infomover/jobmanager/impl/JobManagerImpl.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- JobManagerImpl.java 21 Aug 2002 20:58:58 -0000 1.5
+++ JobManagerImpl.java 22 Aug 2002 00:25:35 -0000 1.6
@@ -49,12 +49,11 @@
*/
package org.apache.infomover.jobmanager.impl;
+import org.apache.infomover.connection.*;
import org.apache.infomover.jobmanager.*;
import org.apache.avalon.framework.configuration.*;
import org.apache.avalon.framework.service.*;
import org.apache.avalon.framework.logger.*;
-import org.apache.avalon.cornerstone.services.sockets.SocketManager;
-import org.apache.avalon.cornerstone.services.connection.ConnectionManager;
import org.apache.avalon.cornerstone.services.scheduler.TimeScheduler;
/**
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>