directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r265031 - in /directory/sandbox/trunk/osgi-protocol-providers/trunk/kerberos/src/main/java/org/apache/kerberos: Activator.java KerberosConfig.java KerberosServer.java KerberosServerFactory.java
Date Wed, 31 Aug 2005 12:32:40 GMT
Author: erodriguez
Date: Wed Aug 31 05:32:17 2005
New Revision: 265031

URL: http://svn.apache.org/viewcvs?rev=265031&view=rev
Log:
Formatting:  imports, line breaks, whitespace, or other code convention.

Modified:
    directory/sandbox/trunk/osgi-protocol-providers/trunk/kerberos/src/main/java/org/apache/kerberos/Activator.java
    directory/sandbox/trunk/osgi-protocol-providers/trunk/kerberos/src/main/java/org/apache/kerberos/KerberosConfig.java
    directory/sandbox/trunk/osgi-protocol-providers/trunk/kerberos/src/main/java/org/apache/kerberos/KerberosServer.java
    directory/sandbox/trunk/osgi-protocol-providers/trunk/kerberos/src/main/java/org/apache/kerberos/KerberosServerFactory.java

Modified: directory/sandbox/trunk/osgi-protocol-providers/trunk/kerberos/src/main/java/org/apache/kerberos/Activator.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/osgi-protocol-providers/trunk/kerberos/src/main/java/org/apache/kerberos/Activator.java?rev=265031&r1=265030&r2=265031&view=diff
==============================================================================
--- directory/sandbox/trunk/osgi-protocol-providers/trunk/kerberos/src/main/java/org/apache/kerberos/Activator.java
(original)
+++ directory/sandbox/trunk/osgi-protocol-providers/trunk/kerberos/src/main/java/org/apache/kerberos/Activator.java
Wed Aug 31 05:32:17 2005
@@ -79,8 +79,7 @@
 
         registry = (ServiceRegistry) tracker.getService();
 
-        ServiceReference storeReference = context.getServiceReference( InitialContextFactory.class
-                .getName() );
+        ServiceReference storeReference = context.getServiceReference( InitialContextFactory.class.getName()
);
 
         InitialContextFactory factory = (InitialContextFactory) context.getService( storeReference
);
 
@@ -113,8 +112,7 @@
 
         Dictionary parameters = new Hashtable();
         parameters.put( ConfigurationAdmin.SERVICE_FACTORYPID, FACTORY_PID );
-        registration = context.registerService( ManagedServiceFactory.class.getName(),
-                serverFactory, parameters );
+        registration = context.registerService( ManagedServiceFactory.class.getName(), serverFactory,
parameters );
 
         ServiceReference adminRef = null;
         try
@@ -129,9 +127,8 @@
                 if ( adminRef != null )
                 {
                     admin = (ConfigurationAdmin) context.getService( adminRef );
-                    String filter = "(&(service.factoryPid=" + FACTORY_PID + ")"
-                            + "(|(service.bundleLocation=" + context.getBundle().getLocation()
-                            + ")" + "(service.bundleLocation=NULL)"
+                    String filter = "(&(service.factoryPid=" + FACTORY_PID + ")" + "(|(service.bundleLocation="
+                            + context.getBundle().getLocation() + ")" + "(service.bundleLocation=NULL)"
                             + "(!(service.bundleLocation=*))))";
                     configs = admin.listConfigurations( filter );
                 }
@@ -143,8 +140,7 @@
 
             if ( admin == null || configs == null || configs.length == 0 )
             {
-                serverFactory.updated( KerberosServerFactory.DEFAULT_PID, KerberosConfig
-                        .getDefaultConfig() );
+                serverFactory.updated( KerberosServerFactory.DEFAULT_PID, KerberosConfig.getDefaultConfig()
);
             }
         }
         catch ( ConfigurationException ce )

Modified: directory/sandbox/trunk/osgi-protocol-providers/trunk/kerberos/src/main/java/org/apache/kerberos/KerberosConfig.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/osgi-protocol-providers/trunk/kerberos/src/main/java/org/apache/kerberos/KerberosConfig.java?rev=265031&r1=265030&r2=265031&view=diff
==============================================================================
--- directory/sandbox/trunk/osgi-protocol-providers/trunk/kerberos/src/main/java/org/apache/kerberos/KerberosConfig.java
(original)
+++ directory/sandbox/trunk/osgi-protocol-providers/trunk/kerberos/src/main/java/org/apache/kerberos/KerberosConfig.java
Wed Aug 31 05:32:17 2005
@@ -31,23 +31,23 @@
 
     private int port;
 
-    public KerberosConfig(Dictionary configuration)
+    public KerberosConfig( Dictionary configuration )
     {
-        System.out.println("Got props " + configuration);
+        System.out.println( "Got props " + configuration );
 
-        if (configuration == null)
+        if ( configuration == null )
         {
             configuration = getDefaultConfig();
         }
 
-        port = ((Integer) configuration.get(KERBEROS_PORT_KEY)).intValue();
+        port = ( (Integer) configuration.get( KERBEROS_PORT_KEY ) ).intValue();
 
-        System.out.println("Kerberos got port " + port);
+        System.out.println( "Kerberos got port " + port );
     }
 
-    boolean isDifferent(Dictionary config)
+    boolean isDifferent( Dictionary config )
     {
-        if (port == ((Integer) config.get(KERBEROS_PORT_KEY)).intValue())
+        if ( port == ( (Integer) config.get( KERBEROS_PORT_KEY ) ).intValue() )
         {
             return false;
         }
@@ -62,7 +62,7 @@
 
     int getPort()
     {
-        System.out.println("Config returning " + port);
+        System.out.println( "Config returning " + port );
 
         return port;
     }
@@ -71,9 +71,8 @@
     {
         Dictionary defaults = new Hashtable();
 
-        defaults.put(SERVICE_PID, PID);
-        defaults.put(KERBEROS_PORT_KEY, Integer.getInteger(KERBEROS_PORT_KEY, new Integer(
-                KERBEROS_PORT_DEFAULT)));
+        defaults.put( SERVICE_PID, PID );
+        defaults.put( KERBEROS_PORT_KEY, Integer.getInteger( KERBEROS_PORT_KEY, new Integer(
KERBEROS_PORT_DEFAULT ) ) );
 
         return defaults;
     }

Modified: directory/sandbox/trunk/osgi-protocol-providers/trunk/kerberos/src/main/java/org/apache/kerberos/KerberosServer.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/osgi-protocol-providers/trunk/kerberos/src/main/java/org/apache/kerberos/KerberosServer.java?rev=265031&r1=265030&r2=265031&view=diff
==============================================================================
--- directory/sandbox/trunk/osgi-protocol-providers/trunk/kerberos/src/main/java/org/apache/kerberos/KerberosServer.java
(original)
+++ directory/sandbox/trunk/osgi-protocol-providers/trunk/kerberos/src/main/java/org/apache/kerberos/KerberosServer.java
Wed Aug 31 05:32:17 2005
@@ -41,7 +41,7 @@
     private String name;
     private int port = -1;
 
-    public KerberosServer(KerberosConfig config, ServiceRegistry registry, PrincipalStore
store)
+    public KerberosServer( KerberosConfig config, ServiceRegistry registry, PrincipalStore
store )
     {
         this.config = config;
         this.registry = registry;
@@ -57,39 +57,39 @@
 
         try
         {
-            System.out.println(name + " starting on " + port);
+            System.out.println( name + " starting on " + port );
 
-            provider = new KerberosProtocolProvider(new KdcConfiguration(), store);
+            provider = new KerberosProtocolProvider( new KdcConfiguration(), store );
 
-            udpService = new Service(name, TransportType.DATAGRAM, port);
-            tcpService = new Service(name, TransportType.SOCKET, port);
+            udpService = new Service( name, TransportType.DATAGRAM, port );
+            tcpService = new Service( name, TransportType.SOCKET, port );
 
-            registry.bind(udpService, provider);
-            registry.bind(tcpService, provider);
+            registry.bind( udpService, provider );
+            registry.bind( tcpService, provider );
 
-            System.out.println(name + " listening on port " + port);
+            System.out.println( name + " listening on port " + port );
         }
-        catch (IOException ioe)
+        catch ( IOException ioe )
         {
             ioe.printStackTrace();
         }
     }
 
-    public boolean isDifferent(Dictionary newConfig)
+    public boolean isDifferent( Dictionary newConfig )
     {
-        return config.isDifferent(newConfig);
+        return config.isDifferent( newConfig );
     }
 
     public void destroy()
     {
-        registry.unbind(udpService);
-        registry.unbind(tcpService);
+        registry.unbind( udpService );
+        registry.unbind( tcpService );
 
         registry = null;
         provider = null;
         udpService = null;
         tcpService = null;
 
-        System.out.println(name + " has stopped listening on " + port);
+        System.out.println( name + " has stopped listening on " + port );
     }
 }

Modified: directory/sandbox/trunk/osgi-protocol-providers/trunk/kerberos/src/main/java/org/apache/kerberos/KerberosServerFactory.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/osgi-protocol-providers/trunk/kerberos/src/main/java/org/apache/kerberos/KerberosServerFactory.java?rev=265031&r1=265030&r2=265031&view=diff
==============================================================================
--- directory/sandbox/trunk/osgi-protocol-providers/trunk/kerberos/src/main/java/org/apache/kerberos/KerberosServerFactory.java
(original)
+++ directory/sandbox/trunk/osgi-protocol-providers/trunk/kerberos/src/main/java/org/apache/kerberos/KerberosServerFactory.java
Wed Aug 31 05:32:17 2005
@@ -37,7 +37,7 @@
 
     Object updateLock = new Object();
 
-    KerberosServerFactory(ServiceRegistry registry, PrincipalStore store)
+    KerberosServerFactory( ServiceRegistry registry, PrincipalStore store )
     {
         this.registry = registry;
         this.store = store;
@@ -46,64 +46,63 @@
     public void destroy()
     {
         Iterator it = servers.keySet().iterator();
-        while (it.hasNext())
+        while ( it.hasNext() )
         {
-            deleted((String) it.next());
+            deleted( (String) it.next() );
         }
     }
 
-    public void updated(String pid, Dictionary config) throws ConfigurationException
+    public void updated( String pid, Dictionary config ) throws ConfigurationException
     {
-        int port = ((Integer) config.get(KerberosConfig.KERBEROS_PORT_KEY)).intValue();
+        int port = ( (Integer) config.get( KerberosConfig.KERBEROS_PORT_KEY ) ).intValue();
 
-        if (port < 1 || port > 0xFFFF)
+        if ( port < 1 || port > 0xFFFF )
         {
-            throw new ConfigurationException(KerberosConfig.KERBEROS_PORT_KEY, "invalid value="
-                    + port);
+            throw new ConfigurationException( KerberosConfig.KERBEROS_PORT_KEY, "invalid
value=" + port );
         }
 
-        synchronized (updateLock)
+        synchronized ( updateLock )
         {
-            if (DEFAULT_PID.equals(pid) && servers.size() > 0)
+            if ( DEFAULT_PID.equals( pid ) && servers.size() > 0 )
             {
                 return;
             }
 
             // As soon as we get a "non-default"-config, delete default
-            if (!DEFAULT_PID.equals(pid) && (null != servers.get(DEFAULT_PID)))
+            if ( !DEFAULT_PID.equals( pid ) && ( null != servers.get( DEFAULT_PID
) ) )
             {
-                deleted(DEFAULT_PID);
+                deleted( DEFAULT_PID );
             }
 
             // for a given pid-config, do we have the service?
             // if not, create it with the config
-            KerberosServer server = (KerberosServer) servers.get(pid);
-            if (server == null)
+            KerberosServer server = (KerberosServer) servers.get( pid );
+            if ( server == null )
             {
-                server = new KerberosServer(new KerberosConfig(config), registry, store);
-                servers.put(pid, server);
+                server = new KerberosServer( new KerberosConfig( config ), registry, store
);
+                servers.put( pid, server );
             }
             else
             {
                 // we have the service, so ...
                 // for a given config, is the config different?
-                if (server.isDifferent(config))
+                if ( server.isDifferent( config ) )
                 {
                     // the config for this service is different, so ...
                     // destroy the listener and recreate it with the new config.
-                    deleted(pid);
-                    server = new KerberosServer(new KerberosConfig(config), registry, store);
-                    servers.put(pid, server);
+                    deleted( pid );
+                    server = new KerberosServer( new KerberosConfig( config ), registry,
store );
+                    servers.put( pid, server );
                 }
             }
         }
     }
 
-    public void deleted(String pid)
+    public void deleted( String pid )
     {
-        KerberosServer server = (KerberosServer) servers.remove(pid);
+        KerberosServer server = (KerberosServer) servers.remove( pid );
 
-        if (server != null)
+        if ( server != null )
         {
             server.destroy();
         }



Mime
View raw message