KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > appserv > naming > GroupInfoServiceObserverImpl


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package com.sun.appserv.naming;
25
26 import java.util.List JavaDoc;
27
28 import com.sun.corba.ee.spi.folb.GroupInfoServiceObserver;
29 import com.sun.corba.ee.spi.folb.GroupInfoService;
30 import com.sun.corba.ee.spi.folb.ClusterInstanceInfo;
31 import com.sun.corba.ee.impl.orbutil.ORBConstants;
32
33 import com.sun.enterprise.util.ORBManager;
34 import java.util.logging.Logger JavaDoc;
35 import java.util.logging.Level JavaDoc;
36 import com.sun.logging.LogDomains;
37
38
39 /**
40  * Called when the GroupInfoService that you register with
41  * has a change. You should call the GroupInfoService
42  * <code>getClusterInstanceInfo</code> method to get
43  * updated info.
44  * @author Sheetal Vartak
45  */

46 public class GroupInfoServiceObserverImpl
47     implements GroupInfoServiceObserver {
48
49     protected static Logger JavaDoc _logger = LogDomains.getLogger(
50                        LogDomains.JNDI_LOGGER);
51     private GroupInfoService gis;
52
53     public GroupInfoServiceObserverImpl(GroupInfoService gis) {
54     this.gis = gis;
55     }
56
57     public void membershipChange() {
58
59     try {
60         List JavaDoc<ClusterInstanceInfo> instanceInfoList = gis.getClusterInstanceInfo((String JavaDoc[])null);
61         
62         S1ASCtxFactory.getRRPolicy().setClusterInstanceInfo(instanceInfoList);
63     } catch(Exception JavaDoc e) {
64         _logger.log(Level.SEVERE, "groupinfoservice.membership.notification.problem", new Object JavaDoc[] {e.getMessage()});
65     }
66     }
67
68 }
69
Popular Tags