karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ioca...@apache.org
Subject svn commit: r1103469 - in /karaf/cellar/branches/cellar-2.2.x: ./ core/src/main/java/org/apache/karaf/cellar/core/event/ core/src/main/resources/ core/src/main/resources/OSGI-INF/ core/src/main/resources/OSGI-INF/blueprint/ hazelcast/ hazelcast/src/mai...
Date Sun, 15 May 2011 17:30:46 GMT
Author: iocanel
Date: Sun May 15 17:30:45 2011
New Revision: 1103469

URL: http://svn.apache.org/viewvc?rev=1103469&view=rev
Log:
Merged from trunk
[KARAF-640] Added configuration file, which contains hazelcast instance configuration (mutlicast,tcpip
etc). Added a factory for creating Hazelcast service configuration. [from revision 1103447]
[KARAF-640] Removed HazelcastConfigurationFactory, which is now obsolete. [from revision 1103456]

Added:
    karaf/cellar/branches/cellar-2.2.x/core/src/main/java/org/apache/karaf/cellar/core/event/EventHandlerRegistryDispatcher.java
      - copied unchanged from r1103447, karaf/cellar/trunk/core/src/main/java/org/apache/karaf/cellar/core/event/EventHandlerRegistryDispatcher.java
    karaf/cellar/branches/cellar-2.2.x/core/src/main/resources/
      - copied from r1103447, karaf/cellar/trunk/core/src/main/resources/
    karaf/cellar/branches/cellar-2.2.x/core/src/main/resources/OSGI-INF/
      - copied from r1103447, karaf/cellar/trunk/core/src/main/resources/OSGI-INF/
    karaf/cellar/branches/cellar-2.2.x/core/src/main/resources/OSGI-INF/blueprint/
      - copied from r1103447, karaf/cellar/trunk/core/src/main/resources/OSGI-INF/blueprint/
    karaf/cellar/branches/cellar-2.2.x/core/src/main/resources/OSGI-INF/blueprint/blueprint.xml
      - copied unchanged from r1103447, karaf/cellar/trunk/core/src/main/resources/OSGI-INF/blueprint/blueprint.xml
    karaf/cellar/branches/cellar-2.2.x/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastInstanceAware.java
      - copied unchanged from r1103447, karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastInstanceAware.java
    karaf/cellar/branches/cellar-2.2.x/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/factory/HazelcastServiceFactory.java
      - copied unchanged from r1103447, karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/factory/HazelcastServiceFactory.java
    karaf/cellar/branches/cellar-2.2.x/hazelcast/src/test/java/org/
      - copied from r1103447, karaf/cellar/trunk/hazelcast/src/test/java/org/
    karaf/cellar/branches/cellar-2.2.x/hazelcast/src/test/java/org/apache/
      - copied from r1103447, karaf/cellar/trunk/hazelcast/src/test/java/org/apache/
    karaf/cellar/branches/cellar-2.2.x/hazelcast/src/test/java/org/apache/karaf/
      - copied from r1103447, karaf/cellar/trunk/hazelcast/src/test/java/org/apache/karaf/
    karaf/cellar/branches/cellar-2.2.x/hazelcast/src/test/java/org/apache/karaf/cellar/
      - copied from r1103447, karaf/cellar/trunk/hazelcast/src/test/java/org/apache/karaf/cellar/
    karaf/cellar/branches/cellar-2.2.x/hazelcast/src/test/java/org/apache/karaf/cellar/hazelcast/
      - copied from r1103447, karaf/cellar/trunk/hazelcast/src/test/java/org/apache/karaf/cellar/hazelcast/
    karaf/cellar/branches/cellar-2.2.x/hazelcast/src/test/java/org/apache/karaf/cellar/hazelcast/factory/
      - copied from r1103447, karaf/cellar/trunk/hazelcast/src/test/java/org/apache/karaf/cellar/hazelcast/factory/
    karaf/cellar/branches/cellar-2.2.x/hazelcast/src/test/java/org/apache/karaf/cellar/hazelcast/factory/HazelcastServiceFactoryTest.java
      - copied unchanged from r1103447, karaf/cellar/trunk/hazelcast/src/test/java/org/apache/karaf/cellar/hazelcast/factory/HazelcastServiceFactoryTest.java
    karaf/cellar/branches/cellar-2.2.x/src/main/resources/instance.cfg
      - copied unchanged from r1103447, karaf/cellar/trunk/src/main/resources/instance.cfg
Modified:
    karaf/cellar/branches/cellar-2.2.x/   (props changed)
    karaf/cellar/branches/cellar-2.2.x/core/src/main/java/org/apache/karaf/cellar/core/event/EventHandlerServiceRegistry.java
    karaf/cellar/branches/cellar-2.2.x/hazelcast/pom.xml
    karaf/cellar/branches/cellar-2.2.x/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastClusterManager.java
    karaf/cellar/branches/cellar-2.2.x/hazelcast/src/main/resources/META-INF/spring/beans.xml
    karaf/cellar/branches/cellar-2.2.x/pom.xml
    karaf/cellar/branches/cellar-2.2.x/src/main/resources/feature.xml
    karaf/cellar/branches/cellar-2.2.x/src/main/resources/groups.cfg

Propchange: karaf/cellar/branches/cellar-2.2.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun May 15 17:30:45 2011
@@ -1 +1 @@
-/karaf/cellar/trunk:1101991
+/karaf/cellar/trunk:1101991,1103447,1103456

Modified: karaf/cellar/branches/cellar-2.2.x/core/src/main/java/org/apache/karaf/cellar/core/event/EventHandlerServiceRegistry.java
URL: http://svn.apache.org/viewvc/karaf/cellar/branches/cellar-2.2.x/core/src/main/java/org/apache/karaf/cellar/core/event/EventHandlerServiceRegistry.java?rev=1103469&r1=1103468&r2=1103469&view=diff
==============================================================================
--- karaf/cellar/branches/cellar-2.2.x/core/src/main/java/org/apache/karaf/cellar/core/event/EventHandlerServiceRegistry.java
(original)
+++ karaf/cellar/branches/cellar-2.2.x/core/src/main/java/org/apache/karaf/cellar/core/event/EventHandlerServiceRegistry.java
Sun May 15 17:30:45 2011
@@ -14,7 +14,6 @@
 package org.apache.karaf.cellar.core.event;
 
 import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleReference;
 import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.framework.ServiceReference;
 import org.slf4j.Logger;
@@ -25,7 +24,9 @@ import org.slf4j.LoggerFactory;
  */
 public class EventHandlerServiceRegistry<E extends Event> implements EventHandlerRegistry<E>
{
 
-    private static final Logger logger = LoggerFactory.getLogger(EventHandlerServiceRegistryDispatcher.class);
+    private static final Logger logger = LoggerFactory.getLogger(EventHandlerRegistryDispatcher.class);
+
+    private BundleContext bundleContext;
 
     /**
      * Returns the appropriate {@code EventHandler} found inside the {@code HandlerRegistry}.
@@ -34,7 +35,6 @@ public class EventHandlerServiceRegistry
      * @return
      */
     public EventHandler<E> getHandler(E event) {
-        BundleContext bundleContext = ((BundleReference) getClass().getClassLoader()).getBundle().getBundleContext();
 
         ServiceReference[] references = new ServiceReference[0];
         try {
@@ -60,4 +60,11 @@ public class EventHandlerServiceRegistry
         return null;
     }
 
+    public BundleContext getBundleContext() {
+        return bundleContext;
+    }
+
+    public void setBundleContext(BundleContext bundleContext) {
+        this.bundleContext = bundleContext;
+    }
 }

Modified: karaf/cellar/branches/cellar-2.2.x/hazelcast/pom.xml
URL: http://svn.apache.org/viewvc/karaf/cellar/branches/cellar-2.2.x/hazelcast/pom.xml?rev=1103469&r1=1103468&r2=1103469&view=diff
==============================================================================
--- karaf/cellar/branches/cellar-2.2.x/hazelcast/pom.xml (original)
+++ karaf/cellar/branches/cellar-2.2.x/hazelcast/pom.xml Sun May 15 17:30:45 2011
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
     <!--
 
@@ -37,6 +38,7 @@
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <osgi.import>
             !org.apache.karaf.cellar.hazelcast*,
+            com.hazelcast*,
             org.apache.karaf.cellar.core*;version="${project.version}",
             org.apache.karaf.cellar.core*;version="${project.version}",
             org.apache.karaf.cellar.config;version="${project.version}",

Modified: karaf/cellar/branches/cellar-2.2.x/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastClusterManager.java
URL: http://svn.apache.org/viewvc/karaf/cellar/branches/cellar-2.2.x/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastClusterManager.java?rev=1103469&r1=1103468&r2=1103469&view=diff
==============================================================================
--- karaf/cellar/branches/cellar-2.2.x/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastClusterManager.java
(original)
+++ karaf/cellar/branches/cellar-2.2.x/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastClusterManager.java
Sun May 15 17:30:45 2011
@@ -14,7 +14,6 @@
 package org.apache.karaf.cellar.hazelcast;
 
 import com.hazelcast.core.Cluster;
-import com.hazelcast.core.HazelcastInstance;
 import com.hazelcast.core.ITopic;
 import com.hazelcast.core.IdGenerator;
 import com.hazelcast.core.Member;
@@ -35,13 +34,12 @@ import java.util.Set;
 /**
  * Hazelcast cluster manager.
  */
-public class HazelcastClusterManager implements ClusterManager {
+public class HazelcastClusterManager extends HazelcastInstanceAware implements ClusterManager
{
 
     private static final Logger logger = org.slf4j.LoggerFactory.getLogger(HazelcastClusterManager.class);
 
     private static final String GENERATOR_ID = "org.apache.karaf.cellar.idgen";
 
-    private HazelcastInstance instance;
     private IdGenerator idgenerator;
 
     private List<EventProducer> producerList;
@@ -191,24 +189,6 @@ public class HazelcastClusterManager imp
         instance.restart();
     }
 
-    /**
-     * Returns the Hazelcast instance.
-     *
-     * @return
-     */
-    public HazelcastInstance getInstance() {
-        return instance;
-    }
-
-    /**
-     * Sets the Hazelcast instance.
-     *
-     * @param instance
-     */
-    public void setInstance(HazelcastInstance instance) {
-        this.instance = instance;
-    }
-
     public ConfigurationAdmin getConfigurationAdmin() {
         return configurationAdmin;
     }

Modified: karaf/cellar/branches/cellar-2.2.x/hazelcast/src/main/resources/META-INF/spring/beans.xml
URL: http://svn.apache.org/viewvc/karaf/cellar/branches/cellar-2.2.x/hazelcast/src/main/resources/META-INF/spring/beans.xml?rev=1103469&r1=1103468&r2=1103469&view=diff
==============================================================================
--- karaf/cellar/branches/cellar-2.2.x/hazelcast/src/main/resources/META-INF/spring/beans.xml
(original)
+++ karaf/cellar/branches/cellar-2.2.x/hazelcast/src/main/resources/META-INF/spring/beans.xml
Sun May 15 17:30:45 2011
@@ -19,18 +19,25 @@
        xsi:schemaLocation="
         http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
         http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd
-        http://www.springframework.org/schema/osgi-compendium http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd
-       ">
+        http://www.springframework.org/schema/osgi-compendium http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd">
+
 
     <!-- Hazelcast hazelcast -->
-    <bean id="hazelcast" class="com.hazelcast.core.Hazelcast" factory-method="newHazelcastInstance"
-          destroy-method="shutdown">
-        <constructor-arg ref="config"/>
+    <bean id="hazelcast" class="com.hazelcast.core.Hazelcast" factory-bean="instanceFactory"
+          factory-method="buildInstance" destroy-method="shutdown"/>
+
+
+    <bean id="instanceFactory" class="org.apache.karaf.cellar.hazelcast.factory.HazelcastServiceFactory"
+          destroy-method="destroy">
+        <osgix:managed-properties persistent-id="org.apache.karaf.cellar.instance" update-strategy="bean-managed"
+                                  update-method="createOrUpdate"/>
     </bean>
 
+
     <bean id="membershipListener" class="org.apache.karaf.cellar.hazelcast.CellarMembershipListener">
         <constructor-arg index="0" ref="hazelcast"/>
         <property name="synchronizers" ref="synchronizers"/>
+        <property name="groupManager" ref="groupManager"/>
     </bean>
 
     <!-- Cluster Manager -->
@@ -116,25 +123,14 @@
     <bean id="commandStore" class="org.apache.karaf.cellar.core.command.BasicCommandStore"/>
 
 
-    <bean id="dispatcher" class="org.apache.karaf.cellar.core.event.EventHandlerServiceRegistryDispatcher"
init-method="init">
+    <bean id="dispatcher" class="org.apache.karaf.cellar.core.event.EventHandlerRegistryDispatcher"
init-method="init">
         <property name="handlerRegistry" ref="registry"/>
     </bean>
 
-    <!-- Registry -->
-    <bean id="registry" class="org.apache.karaf.cellar.core.event.EventHandlerServiceRegistry"/>
-
-    <!-- Hazelcast Config -->
-    <bean id="config" class="com.hazelcast.config.Config">
-        <property name="groupConfig" ref="groupConfig"/>
-    </bean>
-
-    <bean id="groupConfig" class="com.hazelcast.config.GroupConfig">
-        <property name="name" value="dev"/>
-        <property name="password" value="pwd"/>
-    </bean>
 
     <!-- Hazelcast Instance Service-->
     <osgi:service ref="hazelcast" interface="com.hazelcast.core.HazelcastInstance"/>
+
     <osgi:service ref="producer" interface="org.apache.karaf.cellar.core.event.EventProducer"/>
 
     <osgi:service ref="clusterManager" interface="org.apache.karaf.cellar.core.ClusterManager"/>
@@ -152,6 +148,7 @@
     <osgi:service ref="manageGroupCommandHandler" interface="org.apache.karaf.cellar.core.event.EventHandler"/>
     <osgi:service ref="manageGroupResultHandler" interface="org.apache.karaf.cellar.core.event.EventHandler"/>
 
+    <osgi:reference id="registry" interface="org.apache.karaf.cellar.core.event.EventHandlerRegistry"/>
     <osgi:reference id="configurationAdmin" interface="org.osgi.service.cm.ConfigurationAdmin"/>
 
     <!-- Group Consumer & Producer Serices -->

Modified: karaf/cellar/branches/cellar-2.2.x/pom.xml
URL: http://svn.apache.org/viewvc/karaf/cellar/branches/cellar-2.2.x/pom.xml?rev=1103469&r1=1103468&r2=1103469&view=diff
==============================================================================
--- karaf/cellar/branches/cellar-2.2.x/pom.xml (original)
+++ karaf/cellar/branches/cellar-2.2.x/pom.xml Sun May 15 17:30:45 2011
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
     <!--
 
@@ -95,6 +96,11 @@
                                     <type>cfg</type>
                                     <classifier>node</classifier>
                                 </artifact>
+                                <artifact>
+                                    <file>target/instance.cfg</file>
+                                    <type>cfg</type>
+                                    <classifier>instance</classifier>
+                                </artifact>
                             </artifacts>
                         </configuration>
                     </execution>

Modified: karaf/cellar/branches/cellar-2.2.x/src/main/resources/feature.xml
URL: http://svn.apache.org/viewvc/karaf/cellar/branches/cellar-2.2.x/src/main/resources/feature.xml?rev=1103469&r1=1103468&r2=1103469&view=diff
==============================================================================
--- karaf/cellar/branches/cellar-2.2.x/src/main/resources/feature.xml (original)
+++ karaf/cellar/branches/cellar-2.2.x/src/main/resources/feature.xml Sun May 15 17:30:45
2011
@@ -34,8 +34,15 @@
         <bundle>mvn:org.apache.karaf.cellar/org.apache.karaf.cellar.utils/${project.version}</bundle>
         <bundle>mvn:org.apache.karaf.cellar/org.apache.karaf.cellar.shell/${project.version}</bundle>
         <bundle>mvn:org.apache.karaf.cellar/org.apache.karaf.cellar.hazelcast/${project.version}</bundle>
-        <configfile finalname="/etc/org.apache.karaf.cellar.groups.cfg">mvn:org.apache.karaf/cellar/${project.version}/cfg/groups</configfile>
-        <configfile finalname="/etc/org.apache.karaf.cellar.node.cfg">mvn:org.apache.karaf/cellar/${project.version}/cfg/node</configfile>
+        <configfile finalname="/etc/org.apache.karaf.cellar.instance.cfg">
+            mvn:org.apache.karaf/cellar/${project.version}/cfg/instance
+        </configfile>
+        <configfile finalname="/etc/org.apache.karaf.cellar.groups.cfg">
+            mvn:org.apache.karaf/cellar/${project.version}/cfg/groups
+        </configfile>
+        <configfile finalname="/etc/org.apache.karaf.cellar.node.cfg">
+            mvn:org.apache.karaf/cellar/${project.version}/cfg/node
+        </configfile>
     </feature>
 
 </features>
\ No newline at end of file

Modified: karaf/cellar/branches/cellar-2.2.x/src/main/resources/groups.cfg
URL: http://svn.apache.org/viewvc/karaf/cellar/branches/cellar-2.2.x/src/main/resources/groups.cfg?rev=1103469&r1=1103468&r2=1103469&view=diff
==============================================================================
--- karaf/cellar/branches/cellar-2.2.x/src/main/resources/groups.cfg (original)
+++ karaf/cellar/branches/cellar-2.2.x/src/main/resources/groups.cfg Sun May 15 17:30:45 2011
@@ -1,7 +1,7 @@
 default.config.whitelist.inbound=*
 default.config.whitelist.outbound=*
-default.config.blacklist.inbound=org.apache.karaf.cellar.node,org.apache.karaf.management
-default.config.blacklist.outbound=org.apache.karaf.cellar.node,org.apache.karaf.management
+default.config.blacklist.inbound=org.apache.karaf.cellar.instance,org.apache.karaf.cellar.node,org.apache.karaf.management
+default.config.blacklist.outbound=org.apache.karaf.cellar.instance,org.apache.karaf.cellar.node,org.apache.karaf.management
 default.config.sync=true
 default.features.whitelist.inbound=*
 default.features.whitelist.outbound=*



Mime
View raw message