WEB开发网
开发学院软件开发Java 浅析weblogic10 plugin中的DynamicServerList 阅读

浅析weblogic10 plugin中的DynamicServerList

 2009-09-22 00:00:00 来源:WEB开发网   
核心提示: ServletResponseImpl.java1/*package*/finalvoidwriteHeaders()throwsIOException{23HttpServerhttper=getHttpServer();4if(httper!=null){5booleanisPlugin=f

ServletResponseImpl.java

 1   /*package*/ final void writeHeaders() throws IOException {
 2         
 3     HttpServer httper = getHttpServer();
 4     if (httper != null) {
 5       boolean isPlugin = false;
 6       ServerMBean serverMBean = ManagementService.getRuntimeAccess(
 7               WebAppConfigManager.KERNEL_ID).getServer();
 8       if (serverMBean.getCluster() != null &&
 9           request.getHeader(X_WEBLOGIC_REQUEST_CLUSTERINFO) != null) {
10         
11         String hash = request.getHeader(X_WEBLOGIC_CLUSTER_HASH);
12         String oldHash = hash == null ? "" : hash;
            //MemberControllerImpl is a singlton instance and it's hash is changed when cluster changs
13         String currentHash = MembershipControllerImpl.getInstance().getHash();
14         String passedHash = headers.getHeader(X_WEBLOGIC_CLUSTER_HASH);
15         if (currentHash != null && !currentHash.equals(oldHash)) {
16           String[] servers =
17           MembershipControllerImpl.getInstance().getClusterList(
18               request.getConnection().getChannel());
19                         
20             headers.setHeader(X_WEBLOGIC_CLUSTER_HASH, currentHash);
21             headers.setHeader(X_WEBLOGIC_CLUSTER_LIST, sb.toString());//sb presents servers list string
22           }
23         }
24        } 
25     }

上一页  1 2 3 4 5  下一页

Tags:浅析 weblogic plugin

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接