directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r379051 - /directory/trunks/apacheds/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KerberosServer.java
Date Mon, 20 Feb 2006 08:12:56 GMT
Author: trustin
Date: Mon Feb 20 00:12:54 2006
New Revision: 379051

URL: http://svn.apache.org/viewcvs?rev=379051&view=rev
Log:
Fixed compilation errors in apacheds-protocol-kerberos

Modified:
    directory/trunks/apacheds/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KerberosServer.java

Modified: directory/trunks/apacheds/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KerberosServer.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KerberosServer.java?rev=379051&r1=379050&r2=379051&view=diff
==============================================================================
--- directory/trunks/apacheds/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KerberosServer.java
(original)
+++ directory/trunks/apacheds/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KerberosServer.java
Mon Feb 20 00:12:54 2006
@@ -19,14 +19,13 @@
 
 
 import java.io.IOException;
+import java.net.InetSocketAddress;
 import java.util.Dictionary;
 
 import org.apache.directory.server.kerberos.protocol.KerberosProtocolHandler;
 import org.apache.directory.server.kerberos.shared.store.PrincipalStore;
+import org.apache.mina.common.IoAcceptor;
 import org.apache.mina.common.IoHandler;
-import org.apache.mina.common.TransportType;
-import org.apache.mina.registry.Service;
-import org.apache.mina.registry.ServiceRegistry;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -44,18 +43,16 @@
     private static final Logger log = LoggerFactory.getLogger( KerberosServer.class );
 
     private KdcConfiguration config;
-    private ServiceRegistry registry;
+    private IoAcceptor acceptor;
     private PrincipalStore store;
 
     private IoHandler handler;
-    private Service tcpService;
-    private Service udpService;
 
 
-    public KerberosServer(KdcConfiguration config, ServiceRegistry registry, PrincipalStore
store)
+    public KerberosServer(KdcConfiguration config, IoAcceptor acceptor, PrincipalStore store)
     {
         this.config = config;
-        this.registry = registry;
+        this.acceptor = acceptor;
         this.store = store;
 
         String name = config.getName();
@@ -65,11 +62,7 @@
         {
             handler = new KerberosProtocolHandler( new KdcConfiguration(), this.store );
 
-            udpService = new Service( name, TransportType.DATAGRAM, port );
-            tcpService = new Service( name, TransportType.SOCKET, port );
-
-            registry.bind( udpService, handler );
-            registry.bind( tcpService, handler );
+            acceptor.bind( new InetSocketAddress( port ), handler );
 
             log.debug( name + " listening on port " + port );
         }
@@ -88,13 +81,10 @@
 
     public void destroy()
     {
-        registry.unbind( udpService );
-        registry.unbind( tcpService );
+        acceptor.unbind( new InetSocketAddress( config.getPort() ) );
 
-        registry = null;
+        acceptor = null;
         handler = null;
-        udpService = null;
-        tcpService = null;
 
         log.debug( config.getName() + " has stopped listening on port " + config.getPort()
);
     }



Mime
View raw message