Package org.apache.catalina.cluster

Examples of org.apache.catalina.cluster.Member


     * @see #findSessionMasterMember()
     */
    public synchronized void getAllClusterSessions() {
        if (cluster != null && cluster.getMembers().length > 0) {
            long beforeSendTime = System.currentTimeMillis();
            Member mbr = findSessionMasterMember();
            if(mbr == null) { // No domain member found
                 return;
            }
            SessionMessage msg = new SessionMessageImpl(this.getName(),
                    SessionMessage.EVT_GET_ALL_SESSIONS, null, "GET-ALL",
View Full Code Here


    /**
     * Find the master of the session state
     * @return master member of sessions
     */
    protected Member findSessionMasterMember() {
        Member mbr = null;
        Member mbrs[] = cluster.getMembers();
        String localMemberDomain = cluster.getMembershipService().getLocalMember().getDomain();
        if(isSendClusterDomainOnly()) {
            for (int i = 0; mbr == null && i < mbrs.length; i++) {
                Member member = mbrs[i];
                if(localMemberDomain.equals(member.getDomain()))
                    mbr = member ;
            }
        } else {
            if(mbrs.length != 0 )
                mbr = mbrs[0];
View Full Code Here

                log.error("Starting... no cluster associated with this context:"+getName());
                return;
            }

            if (cluster.getMembers().length > 0) {
                Member mbr = cluster.getMembers()[0];
                SessionMessage msg =
                    new SessionMessageImpl(this.getName(),
                                       SessionMessage.EVT_GET_ALL_SESSIONS,
                                       null,
                                       "GET-ALL",
View Full Code Here

    public void send(ClusterMessage msg, Member dest) {
        try
        {
            msg.setAddress(membershipService.getLocalMember());
            Member destination = dest;
           
            if ( msg instanceof SessionMessage ) {
                SessionMessage smsg = (SessionMessage) msg;
                //if we request session state, send to the oldest of members
                if ((destination == null) &&
                    (smsg.getEventType() == SessionMessage.EVT_GET_ALL_SESSIONS) &&
                    (membershipService.getMembers().length > 0)) {
                        destination = membershipService.getMembers()[0];
                }//end if
            }//end if
            msg.setTimestamp(System.currentTimeMillis());
            java.io.ByteArrayOutputStream outs = new java.io.ByteArrayOutputStream();
            java.io.ObjectOutputStream out = new java.io.ObjectOutputStream(outs);
            out.writeObject(msg);
            byte[] data = outs.toByteArray();
            if(destination != null) {
                  Member tcpdest = dest;
                  if ( (tcpdest != null) && (!membershipService.getLocalMember().equals(tcpdest)))  {
                       clusterSender.sendMessage(msg.getUniqueId(), data, tcpdest);
                  }//end if
            }
            else {
View Full Code Here

            //step 1. Install it locally
        getDeployer().install(contextPath, war);
        */
        //step 2. Send it to each member in the cluster
        Member[] members = getCluster().getMembers();
        Member localMember = getCluster().getLocalMember();
        FileMessageFactory factory = FileMessageFactory.getInstance(new File(
            war.getFile()), false);
        FileMessage msg = new FileMessage(localMember, war.getFile(),
                                          contextPath);
        msg = factory.readMessage(msg);
View Full Code Here

        if (getDeployer().findDeployedApp(contextPath) != null)
            getDeployer().remove(contextPath, undeploy);
            */
            //step 2. Send it to each member in the cluster
        Member[] members = getCluster().getMembers();
        Member localMember = getCluster().getLocalMember();
        UndeployMessage msg = new UndeployMessage(localMember,
                                                  System.currentTimeMillis(),
                                                  "Undeploy:" + contextPath +
                                                  ":" +
                                                  System.currentTimeMillis(),
View Full Code Here

                log.error("Starting... no cluster associated with this context:"+getName());
                return;
            }

            if (cluster.getMembers().length > 0) {
                Member mbr = cluster.getMembers()[0];
                SessionMessage msg =
                    new SessionMessageImpl(this.getName(),
                                       SessionMessage.EVT_GET_ALL_SESSIONS,
                                       null,
                                       "GET-ALL",
View Full Code Here

    public void send(ClusterMessage msg, Member dest) {
        try
        {
            msg.setAddress(membershipService.getLocalMember());
            Member destination = dest;
           
            if ( msg instanceof SessionMessage ) {
                SessionMessage smsg = (SessionMessage) msg;
                //if we request session state, send to the oldest of members
                if ((destination == null) &&
                    (smsg.getEventType() == SessionMessage.EVT_GET_ALL_SESSIONS) &&
                    (membershipService.getMembers().length > 0)) {
                        destination = membershipService.getMembers()[0];
                }//end if
            }//end if
            msg.setTimestamp(System.currentTimeMillis());
            java.io.ByteArrayOutputStream outs = new java.io.ByteArrayOutputStream();
            java.io.ObjectOutputStream out = new java.io.ObjectOutputStream(outs);
            out.writeObject(msg);
            byte[] data = outs.toByteArray();
            if(destination != null) {
                  Member tcpdest = dest;
                  if ( (tcpdest != null) && (!membershipService.getLocalMember().equals(tcpdest)))  {
                       clusterSender.sendMessage(msg.getUniqueId(), data, tcpdest);
                  }//end if
            }
            else {
View Full Code Here

                log.error("Starting... no cluster associated with this context:"+getName());
                return;
            }

            if (cluster.getMembers().length > 0) {
                Member mbr = cluster.getMembers()[0];
                SessionMessage msg =
                    new SessionMessageImpl(this.getName(),
                                       SessionMessage.EVT_GET_ALL_SESSIONS,
                                       null,
                                       "GET-ALL",
View Full Code Here

                log.error("Starting... no cluster associated with this context:"+getName());
                return;
            }

            if (cluster.getMembers().length > 0) {
                Member mbr = cluster.getMembers()[0];
                SessionMessage msg =
                    new SessionMessage(this.getName(),
                                       SessionMessage.EVT_GET_ALL_SESSIONS,
                                       null,
                                       "GET-ALL");
View Full Code Here

TOP

Related Classes of org.apache.catalina.cluster.Member

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.