servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r538365 - in /incubator/servicemix/branches/osgi/servicemix-osgi: ./ bundles/xbean-naming/ dist/ dist/src/main/release/ jmx/ jmx/org.apache.servicemix.osgi.jmx.rmi/ jmx/org.apache.servicemix.osgi.jmx.rmi/src/main/java/org/apache/servicemix/...
Date Tue, 15 May 2007 23:02:20 GMT
Author: gnodet
Date: Tue May 15 16:02:18 2007
New Revision: 538365

URL: http://svn.apache.org/viewvc?view=rev&rev=538365
Log:
Refactor a bit rmi / jmx

Added:
    incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/src/main/java/org/apache/servicemix/osgi/rmi/
      - copied from r538091, incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/src/main/java/org/apache/servicemix/osgi/jmx/
Removed:
    incubator/servicemix/branches/osgi/servicemix-osgi/jmx/org.apache.servicemix.osgi.jmx.server/src/main/java/org/apache/servicemix/osgi/jmx/server/JmxServer.java
    incubator/servicemix/branches/osgi/servicemix-osgi/jmx/org.apache.servicemix.osgi.jmx.server/src/main/java/org/apache/servicemix/osgi/jmx/server/impl/JmxServerImpl.java
    incubator/servicemix/branches/osgi/servicemix-osgi/naming/org.apache.servicemix.osgi.naming.gjndi/src/main/java/org/apache/servicemix/osgi/naming/gjndi/impl/GlobalContext.java
    incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/src/main/java/org/apache/servicemix/osgi/jmx/
Modified:
    incubator/servicemix/branches/osgi/servicemix-osgi/bundles/xbean-naming/   (props changed)
    incubator/servicemix/branches/osgi/servicemix-osgi/bundles/xbean-naming/pom.xml
    incubator/servicemix/branches/osgi/servicemix-osgi/dist/pom.xml
    incubator/servicemix/branches/osgi/servicemix-osgi/dist/src/main/release/config.properties
    incubator/servicemix/branches/osgi/servicemix-osgi/jmx/org.apache.servicemix.osgi.jmx.rmi/
  (props changed)
    incubator/servicemix/branches/osgi/servicemix-osgi/jmx/org.apache.servicemix.osgi.jmx.rmi/pom.xml
    incubator/servicemix/branches/osgi/servicemix-osgi/jmx/org.apache.servicemix.osgi.jmx.rmi/src/main/java/org/apache/servicemix/osgi/jmx/rmi/impl/Activator.java
    incubator/servicemix/branches/osgi/servicemix-osgi/jmx/org.apache.servicemix.osgi.jmx.server/
  (props changed)
    incubator/servicemix/branches/osgi/servicemix-osgi/jmx/org.apache.servicemix.osgi.jmx.server/src/main/java/org/apache/servicemix/osgi/jmx/server/impl/Activator.java
    incubator/servicemix/branches/osgi/servicemix-osgi/jmx/pom.xml
    incubator/servicemix/branches/osgi/servicemix-osgi/naming/org.apache.servicemix.osgi.naming.gjndi/
  (props changed)
    incubator/servicemix/branches/osgi/servicemix-osgi/naming/org.apache.servicemix.osgi.naming.gjndi/pom.xml
    incubator/servicemix/branches/osgi/servicemix-osgi/naming/org.apache.servicemix.osgi.naming.gjndi/src/main/java/org/apache/servicemix/osgi/naming/gjndi/impl/Activator.java
    incubator/servicemix/branches/osgi/servicemix-osgi/pom.xml
    incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/
  (props changed)
    incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/pom.xml
    incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/src/main/java/org/apache/servicemix/osgi/rmi/registry/RmiRegistry.java
    incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/src/main/java/org/apache/servicemix/osgi/rmi/registry/impl/Activator.java
    incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/src/main/java/org/apache/servicemix/osgi/rmi/registry/impl/RmiClassLoaderSpiImpl.java
    incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/src/main/java/org/apache/servicemix/osgi/rmi/registry/impl/RmiRegistryImpl.java
    incubator/servicemix/branches/osgi/servicemix-osgi/rmi/pom.xml
    incubator/servicemix/branches/osgi/servicemix-osgi/transaction/org.apache.servicemix.osgi.transaction.manager/
  (props changed)
    incubator/servicemix/branches/osgi/servicemix-osgi/transaction/org.apache.servicemix.osgi.transaction.manager/src/main/java/org/apache/servicemix/osgi/transaction/manager/impl/Activator.java

Propchange: incubator/servicemix/branches/osgi/servicemix-osgi/bundles/xbean-naming/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue May 15 16:02:18 2007
@@ -0,0 +1,2 @@
+.classpath
+.project

Modified: incubator/servicemix/branches/osgi/servicemix-osgi/bundles/xbean-naming/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/osgi/servicemix-osgi/bundles/xbean-naming/pom.xml?view=diff&rev=538365&r1=538364&r2=538365
==============================================================================
--- incubator/servicemix/branches/osgi/servicemix-osgi/bundles/xbean-naming/pom.xml (original)
+++ incubator/servicemix/branches/osgi/servicemix-osgi/bundles/xbean-naming/pom.xml Tue May
15 16:02:18 2007
@@ -65,7 +65,8 @@
           <instructions>
             <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
             <Export-Package>*;version=${pkgVersion}</Export-Package>
-            <Import-Package>*</Import-Package>
+            <Import-Package>!*</Import-Package>
+            <Fragment-Host>system.bundle; extension:=framework</Fragment-Host>
           </instructions>
         </configuration>
       </plugin>

Modified: incubator/servicemix/branches/osgi/servicemix-osgi/dist/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/osgi/servicemix-osgi/dist/pom.xml?view=diff&rev=538365&r1=538364&r2=538365
==============================================================================
--- incubator/servicemix/branches/osgi/servicemix-osgi/dist/pom.xml (original)
+++ incubator/servicemix/branches/osgi/servicemix-osgi/dist/pom.xml Tue May 15 16:02:18 2007
@@ -31,8 +31,8 @@
               <outputDirectory>target/bundles</outputDirectory>
               <artifactItems>
                 <artifactItem>
-                  <groupId>org.apache.servicemix.osgi.jmx</groupId>
-                  <artifactId>org.apache.servicemix.osgi.jmx.registry</artifactId>
+                  <groupId>org.apache.servicemix.osgi.rmi</groupId>
+                  <artifactId>org.apache.servicemix.osgi.rmi.registry</artifactId>
                   <version>1.0-SNAPSHOT</version>
                 </artifactItem>
                 <artifactItem>

Modified: incubator/servicemix/branches/osgi/servicemix-osgi/dist/src/main/release/config.properties
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/osgi/servicemix-osgi/dist/src/main/release/config.properties?view=diff&rev=538365&r1=538364&r2=538365
==============================================================================
--- incubator/servicemix/branches/osgi/servicemix-osgi/dist/src/main/release/config.properties
(original)
+++ incubator/servicemix/branches/osgi/servicemix-osgi/dist/src/main/release/config.properties
Tue May 15 16:02:18 2007
@@ -27,10 +27,11 @@
 #org.osgi.framework.bootdelegation=sun.*,com.sun.*
 felix.cache.profile=servicemix
 felix.auto.start.1= \
+ file:bundles/org.apache.servicemix.osgi.bundles.xbean-naming-3.0-1.0-SNAPSHOT.jar \
  file:bundles/org.apache.felix.shell-0.9.0-incubator-SNAPSHOT.jar \
  file:bundles/org.apache.felix.shell.tui-0.9.0-incubator-SNAPSHOT.jar \
  file:bundles/org.apache.felix.bundlerepository-0.9.0-incubator-SNAPSHOT.jar \
- file:bundles/org.apache.servicemix.osgi.jmx.registry-1.0-SNAPSHOT.jar \
+ file:bundles/org.apache.servicemix.osgi.rmi.registry-1.0-SNAPSHOT.jar \
  file:bundles/org.apache.servicemix.osgi.jmx.server-1.0-SNAPSHOT.jar \
  file:bundles/org.apache.servicemix.osgi.jmx.rmi-1.0-SNAPSHOT.jar \
  file:bundles/org.apache.servicemix.osgi.bundles.commons-logging-1.1-1.0-SNAPSHOT.jar \
@@ -41,7 +42,6 @@
  file:bundles/org.apache.servicemix.osgi.bundles.howl-1.0.1-1-1.0-SNAPSHOT.jar \
  file:bundles/org.apache.servicemix.osgi.bundles.geronimo-transaction-2.0-SNAPSHOT-1.0-SNAPSHOT.jar
\
  file:bundles/org.apache.servicemix.osgi.transaction.manager-1.0-SNAPSHOT.jar \
- file:bundles/org.apache.servicemix.osgi.bundles.xbean-naming-3.0-1.0-SNAPSHOT.jar \
  file:bundles/org.apache.servicemix.osgi.naming.gjndi-1.0-SNAPSHOT.jar
 felix.log.level=4
 felix.startlevel.framework=1
@@ -51,6 +51,7 @@
 #
 # Bundle config properties.
 #
+org.apache.servicemix.osgi.rmi.registry.port=1098
 org.apache.servicemix.osgi.transaction.manager.logFileDir=./data/log/
 org.osgi.service.http.port=8080
 osgi.shell.telnet=on

Propchange: incubator/servicemix/branches/osgi/servicemix-osgi/jmx/org.apache.servicemix.osgi.jmx.rmi/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue May 15 16:02:18 2007
@@ -1 +1,2 @@
 .project
+.classpath

Modified: incubator/servicemix/branches/osgi/servicemix-osgi/jmx/org.apache.servicemix.osgi.jmx.rmi/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/osgi/servicemix-osgi/jmx/org.apache.servicemix.osgi.jmx.rmi/pom.xml?view=diff&rev=538365&r1=538364&r2=538365
==============================================================================
--- incubator/servicemix/branches/osgi/servicemix-osgi/jmx/org.apache.servicemix.osgi.jmx.rmi/pom.xml
(original)
+++ incubator/servicemix/branches/osgi/servicemix-osgi/jmx/org.apache.servicemix.osgi.jmx.rmi/pom.xml
Tue May 15 16:02:18 2007
@@ -40,8 +40,8 @@
       <scope>provided</scope>
     </dependency>
     <dependency>
-      <groupId>org.apache.servicemix.osgi.jmx</groupId>
-      <artifactId>org.apache.servicemix.osgi.jmx.registry</artifactId>
+      <groupId>org.apache.servicemix.osgi.rmi</groupId>
+      <artifactId>org.apache.servicemix.osgi.rmi.registry</artifactId>
       <version>1.0-SNAPSHOT</version>
       <scope>provided</scope>
     </dependency>

Modified: incubator/servicemix/branches/osgi/servicemix-osgi/jmx/org.apache.servicemix.osgi.jmx.rmi/src/main/java/org/apache/servicemix/osgi/jmx/rmi/impl/Activator.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/osgi/servicemix-osgi/jmx/org.apache.servicemix.osgi.jmx.rmi/src/main/java/org/apache/servicemix/osgi/jmx/rmi/impl/Activator.java?view=diff&rev=538365&r1=538364&r2=538365
==============================================================================
--- incubator/servicemix/branches/osgi/servicemix-osgi/jmx/org.apache.servicemix.osgi.jmx.rmi/src/main/java/org/apache/servicemix/osgi/jmx/rmi/impl/Activator.java
(original)
+++ incubator/servicemix/branches/osgi/servicemix-osgi/jmx/org.apache.servicemix.osgi.jmx.rmi/src/main/java/org/apache/servicemix/osgi/jmx/rmi/impl/Activator.java
Tue May 15 16:02:18 2007
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.servicemix.osgi.jmx.rmi.impl;
 
 import java.net.InetAddress;
@@ -8,13 +24,14 @@
 import javax.management.remote.JMXConnectorServerMBean;
 import javax.management.remote.JMXServiceURL;
 
-import org.apache.servicemix.osgi.jmx.registry.RmiRegistry;
 import org.apache.servicemix.osgi.jmx.rmi.RmiConnector;
+import org.apache.servicemix.osgi.rmi.registry.RmiRegistry;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceEvent;
 import org.osgi.framework.ServiceListener;
 import org.osgi.framework.ServiceReference;
+import org.osgi.framework.ServiceRegistration;
 
 public class Activator implements BundleActivator, ServiceListener {
 
@@ -29,6 +46,8 @@
     private RmiRegistry rmi;
     
     private BundleContext context;
+    
+    private ServiceRegistration registration;
 
     /**
      * Implements BundleActivator.start(). P
@@ -100,15 +119,18 @@
         }
         int port = rmi.getPort();
         String url = "service:jmx:rmi:///jndi/rmi://"+ InetAddress.getLocalHost().getHostAddress()
+ ":" + port + "/jmxrmi";
-        JMXServiceURL address=new JMXServiceURL(url);
+        JMXServiceURL address = new JMXServiceURL(url);
         JMXConnectorServer con = JMXConnectorServerFactory.newJMXConnectorServer(address,
null, this.mbs);
         connector = new RmiConnectorImpl(con);
         connector.start();
-        context.registerService(new String[] { RmiConnector.class.getName(), JMXConnectorServerMBean.class.getName()
}, 
+        registration = context.registerService(
+                                new String[] { RmiConnector.class.getName(), JMXConnectorServerMBean.class.getName()
}, 
                                 connector, null);
     }
     
     protected void stopRmiConnector() throws Exception {
+        System.err.println("Stop connector");
+        registration.unregister();
         if (connector != null) {
             connector.stop();
             connector = null;

Propchange: incubator/servicemix/branches/osgi/servicemix-osgi/jmx/org.apache.servicemix.osgi.jmx.server/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue May 15 16:02:18 2007
@@ -1 +1,2 @@
 .project
+.classpath

Modified: incubator/servicemix/branches/osgi/servicemix-osgi/jmx/org.apache.servicemix.osgi.jmx.server/src/main/java/org/apache/servicemix/osgi/jmx/server/impl/Activator.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/osgi/servicemix-osgi/jmx/org.apache.servicemix.osgi.jmx.server/src/main/java/org/apache/servicemix/osgi/jmx/server/impl/Activator.java?view=diff&rev=538365&r1=538364&r2=538365
==============================================================================
--- incubator/servicemix/branches/osgi/servicemix-osgi/jmx/org.apache.servicemix.osgi.jmx.server/src/main/java/org/apache/servicemix/osgi/jmx/server/impl/Activator.java
(original)
+++ incubator/servicemix/branches/osgi/servicemix-osgi/jmx/org.apache.servicemix.osgi.jmx.server/src/main/java/org/apache/servicemix/osgi/jmx/server/impl/Activator.java
Tue May 15 16:02:18 2007
@@ -1,26 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.servicemix.osgi.jmx.server.impl;
 
 import java.lang.management.ManagementFactory;
 
 import javax.management.MBeanServer;
 
-import org.apache.servicemix.osgi.jmx.server.JmxServer;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
 
 public class Activator implements BundleActivator {
 
-    private JmxServerImpl server;
+    private MBeanServer server;
 
     /**
      * Implements BundleActivator.start(). P
      * @param context the framework context for the bundle.
     **/
     public void start(BundleContext context) throws Exception {
-        MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
-        server = new JmxServerImpl(mbs);
-        context.registerService(new String[] { JmxServer.class.getName(), 
-                                               MBeanServer.class.getName() }, 
+        server = ManagementFactory.getPlatformMBeanServer();
+        context.registerService(new String[] { MBeanServer.class.getName() }, 
                                 server, null);
     }
 

Modified: incubator/servicemix/branches/osgi/servicemix-osgi/jmx/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/osgi/servicemix-osgi/jmx/pom.xml?view=diff&rev=538365&r1=538364&r2=538365
==============================================================================
--- incubator/servicemix/branches/osgi/servicemix-osgi/jmx/pom.xml (original)
+++ incubator/servicemix/branches/osgi/servicemix-osgi/jmx/pom.xml Tue May 15 16:02:18 2007
@@ -15,7 +15,6 @@
   <version>1.0-SNAPSHOT</version>
 
   <modules>
-    <module>org.apache.servicemix.osgi.jmx.registry</module>
     <module>org.apache.servicemix.osgi.jmx.server</module>
     <module>org.apache.servicemix.osgi.jmx.rmi</module>
   </modules>

Propchange: incubator/servicemix/branches/osgi/servicemix-osgi/naming/org.apache.servicemix.osgi.naming.gjndi/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue May 15 16:02:18 2007
@@ -0,0 +1,2 @@
+.classpath
+.project

Modified: incubator/servicemix/branches/osgi/servicemix-osgi/naming/org.apache.servicemix.osgi.naming.gjndi/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/osgi/servicemix-osgi/naming/org.apache.servicemix.osgi.naming.gjndi/pom.xml?view=diff&rev=538365&r1=538364&r2=538365
==============================================================================
--- incubator/servicemix/branches/osgi/servicemix-osgi/naming/org.apache.servicemix.osgi.naming.gjndi/pom.xml
(original)
+++ incubator/servicemix/branches/osgi/servicemix-osgi/naming/org.apache.servicemix.osgi.naming.gjndi/pom.xml
Tue May 15 16:02:18 2007
@@ -46,8 +46,8 @@
       <scope>provided</scope>
     </dependency>
     <dependency>
-      <groupId>org.apache.servicemix.osgi.jmx</groupId>
-      <artifactId>org.apache.servicemix.osgi.jmx.registry</artifactId>
+      <groupId>org.apache.servicemix.osgi.rmi</groupId>
+      <artifactId>org.apache.servicemix.osgi.rmi.registry</artifactId>
       <version>1.0-SNAPSHOT</version>
       <scope>provided</scope>
     </dependency>

Modified: incubator/servicemix/branches/osgi/servicemix-osgi/naming/org.apache.servicemix.osgi.naming.gjndi/src/main/java/org/apache/servicemix/osgi/naming/gjndi/impl/Activator.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/osgi/servicemix-osgi/naming/org.apache.servicemix.osgi.naming.gjndi/src/main/java/org/apache/servicemix/osgi/naming/gjndi/impl/Activator.java?view=diff&rev=538365&r1=538364&r2=538365
==============================================================================
--- incubator/servicemix/branches/osgi/servicemix-osgi/naming/org.apache.servicemix.osgi.naming.gjndi/src/main/java/org/apache/servicemix/osgi/naming/gjndi/impl/Activator.java
(original)
+++ incubator/servicemix/branches/osgi/servicemix-osgi/naming/org.apache.servicemix.osgi.naming.gjndi/src/main/java/org/apache/servicemix/osgi/naming/gjndi/impl/Activator.java
Tue May 15 16:02:18 2007
@@ -1,6 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.servicemix.osgi.naming.gjndi.impl;
 
-import org.apache.servicemix.osgi.jmx.registry.RmiRegistry;
+import javax.naming.Context;
+
+import org.apache.servicemix.osgi.rmi.registry.RmiRegistry;
+import org.apache.xbean.naming.context.WritableContext;
 import org.apache.xbean.naming.global.GlobalContextManager;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
@@ -10,11 +29,6 @@
 
 public class Activator implements BundleActivator, ServiceListener {
 
-    static final String JAVA_NAMING_FACTORY_INITIAL = "java.naming.factory.initial";
-    static final String JAVA_NAMING_FACTORY_URL_PKGS = "java.naming.factory.url.pkgs";
-    static final String JAVA_NAMING_PROVIDER_URL = "java.naming.provider.url";
-
-
     private BundleContext context;
     private ServiceReference rmiRef;
     private RmiRegistry rmi;
@@ -52,8 +66,6 @@
      */
     public void serviceChanged(ServiceEvent event) {
         ServiceReference servicereference = event.getServiceReference();
-        String[] ast = (String[]) (servicereference.getProperty("objectClass"));
-        String as = ast[0];
         switch (event.getType()) {
         case ServiceEvent.REGISTERED:
             rmiRef = servicereference;
@@ -81,12 +93,14 @@
             return;
         }
         int port = rmi.getPort();
-        System.setProperty(JAVA_NAMING_FACTORY_INITIAL, GlobalContextManager.class.getName());
-        System.setProperty(JAVA_NAMING_FACTORY_URL_PKGS, "org.apache.xbean.naming");
-        System.setProperty(JAVA_NAMING_PROVIDER_URL, "rmi://0.0.0.0:" + rmi.getPort());
+        GlobalContextManager.setGlobalContext(new WritableContext(""));
+        System.setProperty(Context.INITIAL_CONTEXT_FACTORY, GlobalContextManager.class.getName());
+        System.setProperty(Context.URL_PKG_PREFIXES, "org.apache.xbean.naming");
+        System.setProperty(Context.PROVIDER_URL, "rmi://0.0.0.0:" + port);
     }
 
     protected void stopRmiGJndi() throws Exception {
+        GlobalContextManager.setGlobalContext(null);
         if (rmi != null) {
             context.ungetService(rmiRef);
             rmi = null;

Modified: incubator/servicemix/branches/osgi/servicemix-osgi/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/osgi/servicemix-osgi/pom.xml?view=diff&rev=538365&r1=538364&r2=538365
==============================================================================
--- incubator/servicemix/branches/osgi/servicemix-osgi/pom.xml (original)
+++ incubator/servicemix/branches/osgi/servicemix-osgi/pom.xml Tue May 15 16:02:18 2007
@@ -5,7 +5,7 @@
   <groupId>org.apache.servicemix</groupId>
   <artifactId>osgi</artifactId>
   <packaging>pom</packaging>
-  <name>ServiceMix OSGi</name>
+  <name>ServiceMix OSGI</name>
   <version>1.0-SNAPSHOT</version>
 
   <modules>

Propchange: incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue May 15 16:02:18 2007
@@ -1 +1,2 @@
 .project
+.classpath

Modified: incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/pom.xml?view=diff&rev=538365&r1=538364&r2=538365
==============================================================================
--- incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/pom.xml
(original)
+++ incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/pom.xml
Tue May 15 16:02:18 2007
@@ -27,7 +27,7 @@
   
   <modelVersion>4.0.0</modelVersion>
   <packaging>jar</packaging>
-  <name>ServiceMix OSGI JMX RMI Registry</name>
+  <name>ServiceMix OSGI RMI Registry</name>
   <groupId>org.apache.servicemix.osgi.rmi</groupId>
   <artifactId>org.apache.servicemix.osgi.rmi.registry</artifactId>
   <version>1.0-SNAPSHOT</version>

Modified: incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/src/main/java/org/apache/servicemix/osgi/rmi/registry/RmiRegistry.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/src/main/java/org/apache/servicemix/osgi/rmi/registry/RmiRegistry.java?view=diff&rev=538365&r1=538091&r2=538365
==============================================================================
--- incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/src/main/java/org/apache/servicemix/osgi/rmi/registry/RmiRegistry.java
(original)
+++ incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/src/main/java/org/apache/servicemix/osgi/rmi/registry/RmiRegistry.java
Tue May 15 16:02:18 2007
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.servicemix.osgi.jmx.registry;
+package org.apache.servicemix.osgi.rmi.registry;
 
 import java.rmi.registry.Registry;
 

Modified: incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/src/main/java/org/apache/servicemix/osgi/rmi/registry/impl/Activator.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/src/main/java/org/apache/servicemix/osgi/rmi/registry/impl/Activator.java?view=diff&rev=538365&r1=538091&r2=538365
==============================================================================
--- incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/src/main/java/org/apache/servicemix/osgi/rmi/registry/impl/Activator.java
(original)
+++ incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/src/main/java/org/apache/servicemix/osgi/rmi/registry/impl/Activator.java
Tue May 15 16:02:18 2007
@@ -1,10 +1,26 @@
-package org.apache.servicemix.osgi.jmx.registry.impl;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.servicemix.osgi.rmi.registry.impl;
 
 import java.rmi.registry.LocateRegistry;
 import java.rmi.registry.Registry;
 import java.rmi.server.UnicastRemoteObject;
 
-import org.apache.servicemix.osgi.jmx.registry.RmiRegistry;
+import org.apache.servicemix.osgi.rmi.registry.RmiRegistry;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
 
@@ -18,11 +34,11 @@
     **/
     public void start(BundleContext context) throws Exception {
         int port = Registry.REGISTRY_PORT;
-        String portS = context.getProperty("org.apache.servicemix.osgi.jmx.registry.port");
+        String portS = context.getProperty("org.apache.servicemix.osgi.rmi.registry.port");
         if (portS != null) {
             port = Integer.parseInt(portS);
         }
-        System.setProperty("java.rmi.server.RMIClassLoaderSpi", RmiClassLoaderSpiImpl.class.getName());
+        //System.setProperty("java.rmi.server.RMIClassLoaderSpi", RmiClassLoaderSpiImpl.class.getName());
         Registry reg = LocateRegistry.createRegistry(port);
         registry = new RmiRegistryImpl(reg, port);
         context.registerService(new String[] { RmiRegistry.class.getName(), Registry.class.getName()
}, 

Modified: incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/src/main/java/org/apache/servicemix/osgi/rmi/registry/impl/RmiClassLoaderSpiImpl.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/src/main/java/org/apache/servicemix/osgi/rmi/registry/impl/RmiClassLoaderSpiImpl.java?view=diff&rev=538365&r1=538091&r2=538365
==============================================================================
--- incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/src/main/java/org/apache/servicemix/osgi/rmi/registry/impl/RmiClassLoaderSpiImpl.java
(original)
+++ incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/src/main/java/org/apache/servicemix/osgi/rmi/registry/impl/RmiClassLoaderSpiImpl.java
Tue May 15 16:02:18 2007
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.servicemix.osgi.jmx.registry.impl;
+package org.apache.servicemix.osgi.rmi.registry.impl;
 
 import java.net.MalformedURLException;
 import java.net.URL;
@@ -40,10 +40,10 @@
     private RMIClassLoaderSpi delegate = RMIClassLoader.getDefaultProviderInstance();
 
     //TODO: Not sure of the best initial size.  Starting with 100 which should be reasonable.
-    private ConcurrentHashMap cachedCodebases = new ConcurrentHashMap(100);
+    private ConcurrentHashMap<String, String> cachedCodebases = new ConcurrentHashMap<String,
String>(100);
 
 
-    public Class loadClass(String codebase, String name, ClassLoader defaultLoader)
+    public Class<?>loadClass(String codebase, String name, ClassLoader defaultLoader)
         throws MalformedURLException, ClassNotFoundException
     {
         if (codebase != null) {
@@ -53,7 +53,7 @@
         return delegate.loadClass(codebase, name, defaultLoader);
     }
     
-    public Class loadProxyClass(String codebase, String[] interfaces, ClassLoader defaultLoader)
+    public Class<?> loadProxyClass(String codebase, String[] interfaces, ClassLoader
defaultLoader)
         throws MalformedURLException, ClassNotFoundException
     {
         if (codebase != null) {
@@ -104,12 +104,12 @@
      */
     private String getNormalizedCodebase(String codebase)
             throws MalformedURLException {
-        String cachedCodebase = (String)cachedCodebases.get(codebase);
+        String cachedCodebase = cachedCodebases.get(codebase);
         if (cachedCodebase != null)
             return cachedCodebase;
 
         String normalizedCodebase = normalizeCodebase(codebase);
-        String oldValue = (String)cachedCodebases.put(codebase, normalizedCodebase);
+        String oldValue = cachedCodebases.put(codebase, normalizedCodebase);
 
         // If there was a previous value remove the one we just added to make sure the
         // cache doesn't grow.
@@ -140,7 +140,7 @@
             if ( item.indexOf(':') != -1 )
             {
                 try {
-                    URL url = new URL(item);
+                    new URL(item);
                     // If we got this far then item is a valid url, so commit the current
                     // buffer and start collecting any trailing bits from where we are now
                     updateCodebase(working, codebase);
@@ -179,8 +179,7 @@
         }
     }
     
-    static URL normalizeURL(URL url)
-    {
+    static URL normalizeURL(URL url) {
         assert url != null;
         
         if (url.getProtocol().equals("file")) {

Modified: incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/src/main/java/org/apache/servicemix/osgi/rmi/registry/impl/RmiRegistryImpl.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/src/main/java/org/apache/servicemix/osgi/rmi/registry/impl/RmiRegistryImpl.java?view=diff&rev=538365&r1=538091&r2=538365
==============================================================================
--- incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/src/main/java/org/apache/servicemix/osgi/rmi/registry/impl/RmiRegistryImpl.java
(original)
+++ incubator/servicemix/branches/osgi/servicemix-osgi/rmi/org.apache.servicemix.osgi.rmi.registry/src/main/java/org/apache/servicemix/osgi/rmi/registry/impl/RmiRegistryImpl.java
Tue May 15 16:02:18 2007
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.servicemix.osgi.jmx.registry.impl;
+package org.apache.servicemix.osgi.rmi.registry.impl;
 
 import java.rmi.AccessException;
 import java.rmi.AlreadyBoundException;
@@ -23,7 +23,7 @@
 import java.rmi.RemoteException;
 import java.rmi.registry.Registry;
 
-import org.apache.servicemix.osgi.jmx.registry.RmiRegistry;
+import org.apache.servicemix.osgi.rmi.registry.RmiRegistry;
 
 /**
  * 

Modified: incubator/servicemix/branches/osgi/servicemix-osgi/rmi/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/osgi/servicemix-osgi/rmi/pom.xml?view=diff&rev=538365&r1=538364&r2=538365
==============================================================================
--- incubator/servicemix/branches/osgi/servicemix-osgi/rmi/pom.xml (original)
+++ incubator/servicemix/branches/osgi/servicemix-osgi/rmi/pom.xml Tue May 15 16:02:18 2007
@@ -8,7 +8,7 @@
   </parent>
 
   <modelVersion>4.0.0</modelVersion>
-  <name>ServiceMix OSGI Rmi Bundles</name>
+  <name>ServiceMix OSGI RMI Bundles</name>
   <groupId>org.apache.servicemix.osgi</groupId>
   <artifactId>rmi</artifactId>
   <packaging>pom</packaging>

Propchange: incubator/servicemix/branches/osgi/servicemix-osgi/transaction/org.apache.servicemix.osgi.transaction.manager/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue May 15 16:02:18 2007
@@ -1 +1,2 @@
 .project
+.classpath

Modified: incubator/servicemix/branches/osgi/servicemix-osgi/transaction/org.apache.servicemix.osgi.transaction.manager/src/main/java/org/apache/servicemix/osgi/transaction/manager/impl/Activator.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/osgi/servicemix-osgi/transaction/org.apache.servicemix.osgi.transaction.manager/src/main/java/org/apache/servicemix/osgi/transaction/manager/impl/Activator.java?view=diff&rev=538365&r1=538364&r2=538365
==============================================================================
--- incubator/servicemix/branches/osgi/servicemix-osgi/transaction/org.apache.servicemix.osgi.transaction.manager/src/main/java/org/apache/servicemix/osgi/transaction/manager/impl/Activator.java
(original)
+++ incubator/servicemix/branches/osgi/servicemix-osgi/transaction/org.apache.servicemix.osgi.transaction.manager/src/main/java/org/apache/servicemix/osgi/transaction/manager/impl/Activator.java
Tue May 15 16:02:18 2007
@@ -1,14 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.servicemix.osgi.transaction.manager.impl;
 
-import java.io.File;
-import java.net.InetAddress;
 import java.util.List;
 
 import javax.transaction.TransactionManager;
 
 import org.apache.geronimo.transaction.log.HOWLLog;
 import org.apache.geronimo.transaction.manager.GeronimoTransactionManager;
-import org.apache.geronimo.transaction.manager.TransactionLog;
 import org.apache.geronimo.transaction.manager.XidFactory;
 import org.apache.geronimo.transaction.manager.XidFactoryImpl;
 import org.osgi.framework.BundleActivator;
@@ -29,7 +42,6 @@
     public void start(BundleContext context) throws Exception {
         this.context = context;
         XidFactory xidFactory = new XidFactoryImpl();
-        File serverBaseDir = null;
         List resourceManagers = null;
         transactionLog = new HOWLLog(
                                      getString("bufferClassName", "org.objectweb.howl.log.BlockLogBuffer"),




Mime
View raw message