1 package org.jacorb.orb.factory; 2 3 22 23 import java.net.*; 24 import java.io.IOException ; 25 26 import org.apache.avalon.framework.configuration.Configurable; 27 import org.apache.avalon.framework.configuration.ConfigurationException; 28 29 import org.jacorb.util.*; 30 import org.jacorb.orb.*; 31 32 public abstract class PortRangeFactory 33 implements Configurable 34 { 35 protected int portMin = 0; 36 protected int portMax = 0; 37 protected org.jacorb.config.Configuration configuration; 38 39 protected int getPortProperty(String name) 40 throws ConfigurationException 41 { 42 int port = configuration.getAttributeAsInteger(name); 43 44 if (port < 0) 46 { 47 port += 65536; 48 } 49 if ((port <= 0) || (port > 65535)) 50 { 51 throw new RuntimeException ("PortRangeFactory: " + name + " invalid port number"); 52 } 53 54 return port; 55 } 56 } 57 | Popular Tags |