1 23 24 29 30 package com.sun.enterprise.admin.servermgmt; 31 32 import com.sun.enterprise.util.i18n.StringManager; 33 34 import com.sun.enterprise.util.net.NetUtils; 35 36 40 public class PortValidator extends Validator { 41 42 private static final StringManager _strMgr = 43 StringManager.getManager(PortValidator.class); 44 45 46 public PortValidator(String name) { 47 super(name, java.lang.Integer .class); 48 } 49 50 55 public void validate(Object obj) throws InvalidConfigException 56 { 57 super.validate(obj); 58 if (!NetUtils.isPortFree(((Integer )obj).intValue())) { 59 throw new InvalidConfigException( 60 _strMgr.getString("portValidator.in_use", obj)); 61 } 62 } 63 } 64 | Popular Tags |