1 23 package com.sun.enterprise.server.ss; 24 25 import java.net.SocketAddress ; 26 import java.net.InetSocketAddress ; 27 import com.sun.enterprise.config.ConfigBean; 28 import com.sun.enterprise.config.ConfigContext; 29 import com.sun.enterprise.config.serverbeans.Config; 30 import com.sun.enterprise.config.serverbeans.ServerBeansFactory; 31 import com.sun.enterprise.server.ServerContext; 32 33 39 class ASSocketServiceConfig { 40 41 private ConfigBean config = null; 42 private String addressTag = null; 43 private String portTag = null; 44 private int port ; 45 private String address = null; 46 private SocketAddress sAddress = null; 47 48 ASSocketServiceConfig(ConfigBean config) { 49 this.config = config; 50 } 51 52 void setAddressTag(String addressTag) { 53 this.addressTag = addressTag; 54 } 55 56 String getAddressTag() { 57 return this.addressTag; 58 } 59 60 void setPortTag(String portTag) { 61 this.portTag = portTag; 62 } 63 64 String getPortTag() { 65 return this.portTag; 66 } 67 68 int getPort() { 69 return this.port; 70 } 71 72 String getAddress() { 73 return this.address; 74 } 75 76 SocketAddress getSocketAddress() { 77 return this.sAddress; 78 } 79 80 void init() { 81 this.port = Integer.parseInt(config.getAttributeValue(getPortTag())); 82 83 if (getAddressTag() != null) { 84 this.address = config.getAttributeValue(getAddressTag()); 85 } 86 87 String address = getAddress(); 88 if (address != null) { 89 this.sAddress = new InetSocketAddress (address, getPort()); 90 } else { 91 this.sAddress = new InetSocketAddress (getPort()); 92 } 93 } 94 95 public String toString() { 96 return getAddress() + ":" + getPort(); 97 } 98 } 99 | Popular Tags |