public void setSocketFactory(SocketFactory factory) { ProtocolStack stack=getProtocolStack(); Protocol prot=stack != null? stack.getTopProtocol() : null; if(prot != null) prot.setSocketFactory(factory); }
void filterIncomingMessage(DistributionMessage m) { switch (m.getDSFID()) { case JOIN_RESPONSE: JoinResponseMessage jrsp = (JoinResponseMessage) m; if (jrsp.getRejectionMessage() == null && services.getConfig().getTransport().isMcastEnabled()) { byte[] serializedDigest = jrsp.getMessengerData(); ByteArrayInputStream bis = new ByteArrayInputStream(serializedDigest); DataInputStream dis = new DataInputStream(bis); try { Digest digest = new Digest(); digest.readFrom(dis); logger.trace("installing JGroups message digest {}", digest); this.myChannel.getProtocolStack().getTopProtocol() .down(new Event(Event.MERGE_DIGEST, digest)); jrsp.setMessengerData(null); } catch (Exception e) { logger.fatal("Unable to read JGroups messaging digest", e); } } break; default: break; } }
/** * Creates the unicast and multicast sockets and starts the unicast and multicast receiver threads */ public void start() throws Exception { if(use_ip_addrs) { PhysicalAddress tmp=getPhysicalAddress(); if(tmp instanceof IpAddress) { local_addr=new IpAddressUUID(((IpAddress)tmp).getIpAddress(), ((IpAddress)tmp).getPort()); stack.getTopProtocol().down(new Event(Event.SET_LOCAL_ADDRESS, local_addr)); stack.getTopProtocol().up(new Event(Event.SET_LOCAL_ADDRESS, local_addr)); } } fetchLocalAddresses(); if(timer == null) throw new Exception("timer is null"); startDiagnostics(); if(bundler == null) { bundler=createBundler(bundler_type); bundler.init(this); bundler.start(); } // local_addr is null when shared transport setInAllThreadFactories(cluster_name != null? cluster_name.toString() : null, local_addr, thread_naming_pattern); }
/** look for certain messages that may need to be altered before being sent */ void filterOutgoingMessage(DistributionMessage m) { switch (m.getDSFID()) { case JOIN_RESPONSE: JoinResponseMessage jrsp = (JoinResponseMessage) m; if (jrsp.getRejectionMessage() == null && services.getConfig().getTransport().isMcastEnabled()) { // get the multicast message digest and pass it with the join response Digest digest = (Digest) this.myChannel.getProtocolStack().getTopProtocol() .down(Event.GET_DIGEST_EVT); HeapDataOutputStream hdos = new HeapDataOutputStream(500, Version.CURRENT); try { digest.writeTo(hdos); } catch (Exception e) { logger.fatal("Unable to serialize JGroups messaging digest", e); } jrsp.setMessengerData(hdos.toByteArray()); } break; default: break; } }
public void setSocketFactory(SocketFactory factory) { ProtocolStack stack=getProtocolStack(); Protocol prot=stack != null? stack.getTopProtocol() : null; if(prot != null) prot.setSocketFactory(factory); }
try { ProtocolStack stack = mainChannel.getProtocolStack(); Protocol topProtocol = stack.getTopProtocol(); String forkStackId = this.clusterName;
try { ProtocolStack stack = mainChannel.getProtocolStack(); Protocol topProtocol = stack.getTopProtocol(); String forkStackId = this.clusterName;
void filterIncomingMessage(DistributionMessage m) { switch (m.getDSFID()) { case JOIN_RESPONSE: JoinResponseMessage jrsp = (JoinResponseMessage)m; if (jrsp.getRejectionMessage() == null && services.getConfig().getTransport().isMcastEnabled()) { byte[] serializedDigest = jrsp.getMessengerData(); ByteArrayInputStream bis = new ByteArrayInputStream(serializedDigest); DataInputStream dis = new DataInputStream(bis); try { Digest digest = new Digest(); digest.readFrom(dis); if (digest != null) { logger.trace("installing JGroups message digest {}", digest); this.myChannel.getProtocolStack() .getTopProtocol().down(new Event(Event.SET_DIGEST, digest)); jrsp.setMessengerData(null); } } catch (Exception e) { logger.fatal("Unable to read JGroups messaging digest", e); } } break; default: break; } }
/** * Creates the unicast and multicast sockets and starts the unicast and multicast receiver threads */ public void start() throws Exception { if(use_ip_addrs) { PhysicalAddress tmp=getPhysicalAddress(); if(tmp instanceof IpAddress) { local_addr=new IpAddressUUID(((IpAddress)tmp).getIpAddress(), ((IpAddress)tmp).getPort()); stack.getTopProtocol().down(new Event(Event.SET_LOCAL_ADDRESS, local_addr)); stack.getTopProtocol().up(new Event(Event.SET_LOCAL_ADDRESS, local_addr)); } } fetchLocalAddresses(); if(timer == null) throw new Exception("timer is null"); startDiagnostics(); if(bundler == null) { bundler=createBundler(bundler_type); bundler.init(this); bundler.start(); } // local_addr is null when shared transport setInAllThreadFactories(cluster_name != null? cluster_name.toString() : null, local_addr, thread_naming_pattern); }
/** look for certain messages that may need to be altered before being sent */ void filterOutgoingMessage(DistributionMessage m) { switch (m.getDSFID()) { case JOIN_RESPONSE: JoinResponseMessage jrsp = (JoinResponseMessage)m; if (jrsp.getRejectionMessage() == null && services.getConfig().getTransport().isMcastEnabled()) { // get the multicast message digest and pass it with the join response Digest digest = (Digest)this.myChannel.getProtocolStack() .getTopProtocol().down(Event.GET_DIGEST_EVT); HeapDataOutputStream hdos = new HeapDataOutputStream(500, Version.CURRENT); try { digest.writeTo(hdos); } catch (Exception e) { logger.fatal("Unable to serialize JGroups messaging digest", e); } jrsp.setMessengerData(hdos.toByteArray()); } break; default: break; } }