Codota Logo
org.jgroups.stack
Code IndexAdd Codota to your IDE (free)

How to use org.jgroups.stack

Best Java code snippets using org.jgroups.stack (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: wildfly/wildfly

public void setup(List<ProtocolConfiguration> configs) throws Exception {
  if(top_prot == null) {
    top_prot=new Configurator(this).setupProtocolStack(configs);
    top_prot.setUpProtocol(this);
    this.setDownProtocol(top_prot);
    bottom_prot=getBottomProtocol();
    initProtocolStack();
  }
}
origin: wildfly/wildfly

protected void handleRegister(Address sender, DataInput in) {
  GossipData req=readRequest(in, GossipType.REGISTER);
  if(req != null) {
    String          group=req.getGroup();
    Address         addr=req.getAddress();
    PhysicalAddress phys_addr=req.getPhysicalAddress();
    String          logical_name=req.getLogicalName();
    addAddressMapping(sender, group, addr, phys_addr, logical_name);
  }
}
origin: wildfly/wildfly

public void connectStubs() {
  for(RouterStub stub : stubs) {
    try {
      if(!stub.isConnected())
        stub.connect(cluster_name, local_addr, logical_name, phys_addr);
    }
    catch (Throwable e) {
      moveStubToReconnects(stub);
    }
  }
}
origin: wildfly/wildfly

/**
 * Creates an instance of TcpServer.
 * @param bind_addr The local bind address and port. If null, a bind address and port will be picked by the OS.
 */
public TcpServer(IpAddress bind_addr) throws Exception {
  this(bind_addr != null? bind_addr.getIpAddress() : null, bind_addr != null? bind_addr.getPort() : 0);
}
origin: wildfly/wildfly

public void init() throws Exception {
  List<Protocol> protocols=getProtocols();
  Collections.reverse(protocols);
  top_prot=Configurator.connectProtocols(protocols);
  top_prot.setUpProtocol(this);
  this.setDownProtocol(top_prot);
  bottom_prot=getBottomProtocol();
  Configurator.setDefaultValues(protocols);
  initProtocolStack();
}
origin: wildfly/wildfly

public void receive(Address sender, DataInput in) throws Exception {
  GossipData data=new GossipData();
  data.readFrom(in);
  switch(data.getType()) {
    case MESSAGE:
    case SUSPECT:
      if(receiver != null)
        receiver.receive(data);
      break;
    case GET_MBRS_RSP:
      notifyResponse(data.getGroup(), data.getPingData());
      break;
  }
}
origin: wildfly/wildfly

protected void moveStubToReconnects(RouterStub stub) {
  if(stub == null) return;
  remove(stub);
  if(add(new Target(stub.local(), stub.remote(), stub.receiver()))) {
    log.debug("connection to %s closed, trying to re-establish connection", stub.remote());
    startReconnector();
  }
}
origin: wildfly/wildfly

/**
 * A message is sent down the stack. Protocols may examine the message and do something (e.g. add a header) with it
 * before passing it down.
 * @since 4.0
 */
public Object down(Message msg) {
  return down_prot.down(msg);
}
origin: wildfly/wildfly

protected void handleUnregister(DataInput in) {
  GossipData req=readRequest(in, GossipType.UNREGISTER);
  if(req != null)
    removeAddressMapping(req.getGroup(), req.getAddress());
}
origin: wildfly/wildfly

public RouterStub createAndRegisterStub(IpAddress local, IpAddress router_addr) {
  RouterStub stub=new RouterStub(local, router_addr, use_nio, this);
  RouterStub old_stub=unregisterStub(router_addr);
  if(old_stub != null)
    old_stub.destroy();
  add(stub);
  return stub;
}
origin: wildfly/wildfly

public void disconnectStubs() {
  stopReconnector();
  for(RouterStub stub : stubs) {
    try {
      stub.disconnect(cluster_name, local_addr);
    }
    catch (Throwable e) {
    }
  }       
}

origin: wildfly/wildfly

public void disconnect(String group, Address addr) throws Exception {
  writeRequest(new GossipData(GossipType.UNREGISTER, group, addr));
}
origin: wildfly/wildfly

/** Creates a fork-stack from the configuration, initializes all protocols (setting values),
 * sets the protocol stack as top protocol, connects the protocols and calls init() on them. Returns
 * the protocols in a list, from bottom to top */
protected static List<Protocol> createProtocols(ProtocolStack stack, List<ProtocolConfiguration> protocol_configs) throws Exception {
  return Configurator.createProtocols(protocol_configs,stack);
}
origin: wildfly/wildfly

public void start() throws Exception {
  super.start();
  running=true;
  ack_mode=true;
}
origin: wildfly/wildfly

/**
 * Sends an event down the protocol stack. Note that - contrary to {@link #send(Message)}, if the event is a message,
 * no checks are performed whether the channel is closed or disconnected. Note that this method is not typically
 * used by applications.
 * @param evt the message to send down, encapsulated in an event
 */
public Object down(Event evt) {
  if(evt == null) return null;
  return prot_stack.down(evt);
}
origin: wildfly/wildfly

@Override
public synchronized void startStack() throws Exception {
  if(++connects == 1)
    super.startStack();
}
origin: wildfly/wildfly

public TP unregisterProbeHandler(DiagnosticsHandler.ProbeHandler handler) {
  if(diag_handler != null)
    diag_handler.unregisterProbeHandler(handler);
  return this;
}
origin: wildfly/wildfly

public void setup(ProtocolStack stack) throws Exception {
  if(top_prot == null) {
    top_prot=new Configurator(this).setupProtocolStack(stack);
    top_prot.setUpProtocol(this);
    this.setDownProtocol(top_prot);
    bottom_prot=getBottomProtocol();
    initProtocolStack();
  }
}
origin: wildfly/wildfly

public void run() {
  down_prot.down(msg);
  num_stable_msgs_sent++;
}
public String toString() {return STABLE.class.getSimpleName() + ": STABLE-GOSSIP";}
origin: wildfly/wildfly

public Object down(Message msg) {
  // Do something with the event, e.g. add a header to the message
  // Optionally pass down
  return down_prot.down(msg);
}
org.jgroups.stack

Most used classes

  • ProtocolStack
    A ProtocolStack manages a number of protocols layered above each other. It creates all protocol clas
  • IpAddress
    Network-dependent address (Internet). Generated by the bottommost layer of the protocol stack (UDP).
  • Protocol
    The Protocol class provides a set of common services for protocol layers. Each layer has to be a sub
  • Configurator
    The task if this class is to setup and configure the protocol stack. A string describing the desired
  • GossipRouter
    Router for TCP based group comunication (using layer TCP instead of UDP). Instead of the TCP layer s
  • GossipData,
  • RouterStub,
  • AddressGenerator,
  • Configurator$InetAddressInfo,
  • DiagnosticsHandler$ProbeHandler,
  • DiagnosticsHandler,
  • GossipRouter$Entry,
  • GossipType,
  • IpAddressUUID,
  • MembershipChangePolicy,
  • MessageProcessingPolicy,
  • ProtocolHook,
  • RouterStub$CloseListener,
  • RouterStub$MembersNotification
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now