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/09/17 18:41:31 UTC

svn commit: rev 46258 - incubator/directory/seda/trunk/src/java/org/apache/seda/listener

Author: akarasulu
Date: Fri Sep 17 09:41:30 2004
New Revision: 46258

Added:
   incubator/directory/seda/trunk/src/java/org/apache/seda/listener/ListenerAddress.java
   incubator/directory/seda/trunk/src/java/org/apache/seda/listener/SocketListenerAddress.java
   incubator/directory/seda/trunk/src/java/org/apache/seda/listener/TCPListenerConfig.java
      - copied, changed from rev 46257, incubator/directory/seda/trunk/src/java/org/apache/seda/listener/DefaultListenerConfig.java
   incubator/directory/seda/trunk/src/java/org/apache/seda/listener/TCPListenerManager.java
      - copied, changed from rev 46257, incubator/directory/seda/trunk/src/java/org/apache/seda/listener/DefaultListenerManager.java
Removed:
   incubator/directory/seda/trunk/src/java/org/apache/seda/listener/DefaultListenerConfig.java
   incubator/directory/seda/trunk/src/java/org/apache/seda/listener/DefaultListenerManager.java
Log:
Commiting a few changes to make Trustin's patch work.  There were several 
missing classes in the patches which I simply took a guess on to make things
compile.  The echo test now breaks so we have to figure out whats going on.


Added: incubator/directory/seda/trunk/src/java/org/apache/seda/listener/ListenerAddress.java
==============================================================================
--- (empty file)
+++ incubator/directory/seda/trunk/src/java/org/apache/seda/listener/ListenerAddress.java	Fri Sep 17 09:41:30 2004
@@ -0,0 +1,28 @@
+/*
+ *   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.listener;
+
+/**
+ * Document me.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory
+ *         Project</a>
+ * @version $Rev$
+ */
+public class ListenerAddress
+{
+}

Added: incubator/directory/seda/trunk/src/java/org/apache/seda/listener/SocketListenerAddress.java
==============================================================================
--- (empty file)
+++ incubator/directory/seda/trunk/src/java/org/apache/seda/listener/SocketListenerAddress.java	Fri Sep 17 09:41:30 2004
@@ -0,0 +1,44 @@
+/*
+ *   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.listener;
+
+import org.apache.seda.protocol.InetServiceEntry;
+
+import java.net.InetAddress;
+
+/**
+ * Document me.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory
+ *         Project</a>
+ * @version $Rev$
+ */
+public class SocketListenerAddress extends ListenerAddress
+{
+    private final InetAddress address;
+
+    
+    public SocketListenerAddress( InetAddress address )
+    {
+        this.address = address;
+    }
+
+    public final InetAddress getAddress()
+    {
+        return address;
+    }
+}

Copied: incubator/directory/seda/trunk/src/java/org/apache/seda/listener/TCPListenerConfig.java (from rev 46257, incubator/directory/seda/trunk/src/java/org/apache/seda/listener/DefaultListenerConfig.java)
==============================================================================
--- incubator/directory/seda/trunk/src/java/org/apache/seda/listener/DefaultListenerConfig.java	(original)
+++ incubator/directory/seda/trunk/src/java/org/apache/seda/listener/TCPListenerConfig.java	Fri Sep 17 09:41:30 2004
@@ -0,0 +1,121 @@
+/*
+ *   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.listener;
+
+
+import org.apache.seda.protocol.InetServiceEntry;
+
+
+/**
+ * A default server listener.
+ *
+ * @author <a href="mailto:akarasulu@apache.org">Alex Karasulu</a>
+ * @author $LastChangedBy$
+ * @version $LastChangedRevision$
+ */
+public class TCPListenerConfig extends ListenerConfig
+{
+    /** the connection backlog */
+    private int backlog;
+    /** the interface address or hostname of the server */
+    private byte[] address;
+    /** the inet service provided by this listener */
+    private InetServiceEntry servEnt;
+
+    /**
+     * Creates a default listener with all the supplied properties.
+     * 
+     * @param address the address for the server listener
+     * @param servEnt the inet service entry for the service this listner
+     * provides
+     */
+    public TCPListenerConfig( ListenerAddress address, InetServiceEntry servEnt )
+    {
+        super( address );
+        this.servEnt = servEnt;
+    }
+    
+    
+    /* (non-Javadoc)
+     * @see org.apache.seda.listener.ServerListener#getBacklog()
+     */
+    public int getBacklog()
+    {
+        return this.backlog;
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.seda.listener.ServerListener#getURL()
+     */
+    public String getURL()
+    {
+        StringBuffer l_buf = new StringBuffer();
+        
+        l_buf.append( servEnt.getName() );
+        l_buf.append( "://" );
+        l_buf.append( this.address );
+        l_buf.append( ':' );
+        l_buf.append( servEnt.getPort() );
+        
+        return l_buf.toString();
+    }
+
+
+    /**
+     * Gets the Inet service entry for the service this config's listner
+     * provides.
+     *
+     * @return the served service's entry
+     */
+    public InetServiceEntry getInetServiceEntry()
+    {
+        return servEnt;
+    }
+
+
+    /**
+     * Sets the address for the 
+     * 
+     * @param a_address The address to set.
+     */
+    protected void setAddress( byte[] a_address )
+    {
+        this.address = a_address;
+    }
+    
+
+    /**
+     * @param a_backlog The backlog to set.
+     */
+    protected void setBacklog( int a_backlog )
+    {
+        this.backlog = a_backlog;
+    }
+
+    
+    /**
+     * Set's the inet service entry.
+     *
+     * @param servEnt the service entry of the service this listener provides
+     */
+    protected void setInetServiceEntry( InetServiceEntry servEnt )
+    {
+        this.servEnt = servEnt;
+    }
+}
+

Copied: incubator/directory/seda/trunk/src/java/org/apache/seda/listener/TCPListenerManager.java (from rev 46257, incubator/directory/seda/trunk/src/java/org/apache/seda/listener/DefaultListenerManager.java)
==============================================================================
--- incubator/directory/seda/trunk/src/java/org/apache/seda/listener/DefaultListenerManager.java	(original)
+++ incubator/directory/seda/trunk/src/java/org/apache/seda/listener/TCPListenerManager.java	Fri Sep 17 09:41:30 2004
@@ -36,7 +36,7 @@
  * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class DefaultListenerManager 
+public class TCPListenerManager 
     implements
     DisconnectSubscriber,
     ProtocolSubscriber,
@@ -72,7 +72,7 @@
      * @param router the router to publish events to
      * @throws IOException
      */
-    public DefaultListenerManager( EventRouter router ) throws IOException
+    public TCPListenerManager( EventRouter router ) throws IOException
     {
         this.router = router;
         this.clients = new HashSet();