Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, Home of Professional Open Source.
   * Copyright 2013, Red Hat, Inc., and individual contributors
   * as indicated by the @author tags. See the copyright.txt file in the
   * distribution for a full listing of individual contributors.
   *
   * This is free software; you can redistribute it and/or modify it
   * under the terms of the GNU Lesser General Public License as
   * published by the Free Software Foundation; either version 2.1 of
  * the License, or (at your option) any later version.
  *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this software; if not, write to the Free
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  */
 package org.jboss.legacy.jnp.infinispan;
 
 import java.util.Map;
 import  org.jboss.as.clustering.impl.CoreGroupCommunicationService;
 import  org.jboss.ha.framework.interfaces.ClusterNode;
 import  org.jboss.ha.framework.interfaces.DistributedReplicantManager;
 import  org.jboss.ha.framework.interfaces.DistributedState;
 import  org.jboss.ha.framework.interfaces.HAPartition;
 import  org.jboss.ha.framework.interfaces.ResponseFilter;
 import  org.jboss.ha.framework.server.DistributedReplicantManagerImpl;

Author(s):
Emmanuel Hugonnet (c) 2013 Red Hat, inc.
 
 public class InfinispanHAPartition implements HAPartition {
 
     private final CoreGroupCommunicationService service;
     private final Map<HAMembershipListener, HAMembershipListenerAdaptergroupMembershipListeners = new HashMap<HAMembershipListener, HAMembershipListenerAdapter>();
     private final DistributedReplicantManagerImpl distributedReplicantManager;
 
     public InfinispanHAPartition(CoreGroupCommunicationService service) {
         this. = service;
         this. = new DistributedReplicantManagerImpl(this);
     }
 
     @Override
     public String getNodeName() {
         return .getNodeName();
     }
 
     @Override
     public String getPartitionName() {
         return .getGroupName();
     }
 
     @Override
     public DistributedReplicantManager getDistributedReplicantManager() {
         return this.;
     }
 
     @Override
     public DistributedState getDistributedStateService() {
         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
     }
 
     @Override
     public void registerRPCHandler(String serviceNameObject handler) {
         .registerRPCHandler(serviceNamehandler);
     }
 
     @Override
     public void registerRPCHandler(String serviceNameObject handlerClassLoader classloader) {
         .registerRPCHandler(serviceNamehandler);
     }
 
     @Override
     public void unregisterRPCHandler(String serviceNameObject subscriber) {
         .unregisterRPCHandler(serviceNamesubscriber);
     }
 
     @Override
     public ArrayList callMethodOnCluster(String serviceNameString methodNameObject[] argsClass[] typesboolean excludeSelfthrows Exception {
         return new ArrayList(.callMethodOnCluster(serviceNamemethodNameargstypesexcludeSelf));
     }
 
     @Override
     public ArrayList callMethodOnCluster(String serviceNameString methodNameObject[] argsClass[] typesboolean excludeSelffinal ResponseFilter filterthrows Exception {
         return new ArrayList(.callMethodOnCluster(serviceNamemethodNameargstypesexcludeSelfnew ResponseFilterAdapter(filter)));
     }
 
     @Override
     public void callAsynchMethodOnCluster(String serviceNameString methodNameObject[] argsClass[] typesboolean excludeSelfthrows Exception {
         .callAsynchMethodOnCluster(serviceNamemethodNameargstypesexcludeSelf);
     }
    @Override
    public ArrayList callMethodOnCoordinatorNode(String serviceNameString methodNameObject[] argsClass[] typesboolean excludeSelfthrows Exception {
        return .callMethodOnCoordinatorNode(serviceNamemethodNameargstypesexcludeSelf);
    }
    @Override
    public Object callMethodOnNode(String serviceNameString methodNameObject[] argsClass[] typeslong methodTimeout, ClusterNode targetNodethrows Throwable {
        return .callMethodOnNode(serviceNamemethodNameargstypesnew ClusterNodeAdapter(targetNode));
    }
    @Override
    public void callAsyncMethodOnNode(String serviceNameString methodNameObject[] argsClass[] typeslong methodTimeout, ClusterNode targetNodethrows Throwable {
        .callAsyncMethodOnNode(serviceNamemethodNameargstypesnew ClusterNodeAdapter(targetNode));
    }
    @Override
    public void subscribeToStateTransferEvents(String serviceName, HAPartitionStateTransfer subscriber) {
        .registerStateTransferProvider(serviceNamenew StateTransferProviderAdapter(subscriber));
    }
    @Override
    public void unsubscribeFromStateTransferEvents(String serviceName, HAPartitionStateTransfer subscriber) {
        .unregisterStateTransferProvider(serviceName);
    }
    @Override
    public void registerMembershipListener(HAMembershipListener listener) {
        .put(listenernew HAMembershipListenerAdapter(listener));
        .registerGroupMembershipListener(.get(listener));
    }
    @Override
    public void unregisterMembershipListener(HAMembershipListener listener) {
        .unregisterGroupMembershipListener(.get(listener));
    }
    @Override
    public boolean getAllowSynchronousMembershipNotifications() {
        return .getAllowSynchronousMembershipNotifications();
    }
    @Override
    public void setAllowSynchronousMembershipNotifications(boolean allowSync) {
        .setAllowSynchronousMembershipNotifications(allowSync);
    }
    @Override
    public long getCurrentViewId() {
        return .getCurrentViewId();
    }
    @Override
    public Vector getCurrentView() {
        return new Vector(.getCurrentView());
    }
    @Override
    public ClusterNode[] getClusterNodes() {
        return LegacyClusterNodeAdapter.convertToArray(.getClusterNodes());
    }
    @Override
    public ClusterNode getClusterNode() {
        return new LegacyClusterNodeAdapter(.getClusterNode());
    }
    public void start() throws Exception {
        this..createService();
        this..startService();
    }
New to GrepCode? Check out our FAQ X