Skip to content

Commit

Permalink
Remove Hazelcast dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
lasanthaS committed Dec 4, 2023
1 parent 802c7bb commit b0c12d4
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
*/
package org.wso2.carbon.event.processor.core.internal.ds;

import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.MemberAttributeEvent;
import com.hazelcast.core.MembershipEvent;
import com.hazelcast.core.MembershipListener;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.osgi.service.component.ComponentContext;
Expand Down Expand Up @@ -126,41 +122,6 @@ protected void unsetEventStreamService(EventStreamService eventStreamService) {
EventProcessorValueHolder.registerEventStreamService(null);
}

@Reference(
name = "hazelcast.instance.service",
service = com.hazelcast.core.HazelcastInstance.class,
cardinality = ReferenceCardinality.OPTIONAL,
policy = ReferencePolicy.DYNAMIC,
unbind = "unsetHazelcastInstance")
protected void setHazelcastInstance(HazelcastInstance hazelcastInstance) {

EventProcessorValueHolder.registerHazelcastInstance(hazelcastInstance);
hazelcastInstance.getCluster().addMembershipListener(new MembershipListener() {

@Override
public void memberAdded(MembershipEvent membershipEvent) {

}

@Override
public void memberRemoved(MembershipEvent membershipEvent) {

}

@Override
public void memberAttributeChanged(MemberAttributeEvent memberAttributeEvent) {

}
});
EventProcessorValueHolder.getEventProcessorService().notifyServiceAvailability(EventProcessorConstants
.HAZELCAST_INSTANCE);
}

protected void unsetHazelcastInstance(HazelcastInstance hazelcastInstance) {

EventProcessorValueHolder.registerHazelcastInstance(null);
}

@Reference(
name = "user.realm.delegating",
service = org.wso2.carbon.user.core.UserRealm.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package org.wso2.carbon.event.processor.core.internal.ds;

import com.hazelcast.core.HazelcastInstance;
import org.apache.axis2.context.ConfigurationContext;
import org.wso2.carbon.base.api.ServerConfigurationService;
import org.wso2.carbon.event.processor.core.internal.CarbonEventProcessorManagementService;
Expand All @@ -34,7 +33,6 @@ public class EventProcessorValueHolder {
private static CarbonEventProcessorService eventProcessorService;
private static EventManagementService eventManagementService;
private static EventStreamService eventStreamService;
private static HazelcastInstance hazelcastInstance;
private static UserRealm userRealm;
private static DataSourceService dataSourceService;
private static ServerConfigurationService serverConfiguration;
Expand All @@ -60,15 +58,7 @@ public static void registerEventProcessorService(CarbonEventProcessorService ser
public static CarbonEventProcessorService getEventProcessorService() {
return eventProcessorService;
}

public static void registerHazelcastInstance(HazelcastInstance hazelcastInstance) {
EventProcessorValueHolder.hazelcastInstance = hazelcastInstance;
}

public static HazelcastInstance getHazelcastInstance() {
return hazelcastInstance;
}


// public static DataAccessService getDataAccessService() {
// return dataAccessService;
// }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ private EventProcessorConstants() {
public static final String CORRELATION = "correlation";
public static final String META_PREFIX = "meta_";
public static final String CORRELATION_PREFIX = "correlation_";

public static final String HAZELCAST_INSTANCE = "hazelcast.instance";
public static final String NO_DEPENDENCY_INFO_MSG = "No dependency information available for this event formatter";

// For storm query plan builder.
Expand Down

0 comments on commit b0c12d4

Please sign in to comment.