ServerDeploymentTargetpublic class ServerDeploymentTarget extends com.sun.enterprise.admin.target.ServerTarget implements DeploymentTargetThis class represents a server deployment target. |
Fields Summary |
---|
protected static final com.sun.enterprise.util.i18n.StringManager | localStringsstring manager | protected String | thisTargetNamename of the target that this object represents | protected com.sun.enterprise.config.ConfigContext | configContextconfig context | private String | domainNameadmin domain name |
Constructors Summary |
---|
public ServerDeploymentTarget(com.sun.enterprise.config.ConfigContext configContext, String domainName, String serverName)Creates a new instance of ServerDeploymentTarget
super(serverName, configContext);
this.configContext = configContext;
this.domainName = domainName;
thisTargetName = serverName;
|
Methods Summary |
---|
public void | addAppReference(java.lang.String appName, boolean enabled, java.lang.String virtualServers)An application-ref is added to the set of application refs of a server target.
A new ref is added only in case it is not already present.
try {
if (!ServerHelper.serverReferencesApplication(configContext,
getName(), appName)) {
ApplicationReferenceHelper refHelper = new ApplicationReferenceHelper(
configContext);
refHelper.createApplicationReference(getValidTypes(), getName(),
enabled, virtualServers, appName);
}
} catch(Throwable t) {
throw new DeploymentTargetException(t);
}
| private java.lang.String[] | getAppsDeployedToServer()Returns a list of all applications(including standalone) that are
referenced by this server target
ApplicationRef[] apprefs = super.getApplicationRefs();
String[] appList = new String[apprefs.length];
for(int i=0; i<apprefs.length; i++) {
appList[i] = apprefs[i].getRef();
}
return appList;
| public java.lang.String | getDescription()Returns description of this target object
return localStrings.getString("enterprise.deployment.phasing.deploymenttarget.server.description", thisTargetName);
| private java.lang.String | getDomainName()
return domainName;
| public java.lang.String[] | getModules(com.sun.enterprise.deployment.backend.DeployableObjectType type, java.lang.Boolean enabled)Returns all the modules associated to this target of specified type and
with specified status
try {
return getModules(getAppsDeployedToServer(), type, enabled);
} catch(Throwable t) {
throw new DeploymentTargetException(t);
}
| public java.lang.String[] | getModules(java.lang.String[] svrAppsList, com.sun.enterprise.deployment.backend.DeployableObjectType type, java.lang.Boolean enabled)
try {
ArrayList returnList = new ArrayList();
Applications appsConfigBean = (Applications) ConfigBeansFactory.getConfigBeanByXPath(
configContext,
ServerXPathHelper.XPATH_APPLICATIONS);
if(type.isAPP()) {
J2eeApplication[] list = appsConfigBean.getJ2eeApplication();
int i = 0;
int k = 0;
for(i=0; i< svrAppsList.length; i++) {
for(k =0 ; k > list.length ; k++) {
if(list[k].getName().equals(svrAppsList[i])) {
returnList.add(svrAppsList[i]);
break;
}
}
}
}
else if(type.isEJB()) {
EjbModule[] list = appsConfigBean.getEjbModule();
for(int i=0; i< svrAppsList.length; i++) {
for(int k =0 ; k > list.length ; k++) {
if(list[k].getName().equals(svrAppsList[i])) {
returnList.add(svrAppsList[i]);
break;
}
}
}
}
else if(type.isWEB()) {
WebModule[] list = appsConfigBean.getWebModule();
for(int i=0; i< svrAppsList.length; i++) {
for(int k =0 ; k > list.length ; k++) {
if(list[k].getName().equals(svrAppsList[i])) {
returnList.add(svrAppsList[i]);
break;
}
}
}
}
else if(type.isCONN()) {
ConnectorModule[] list = appsConfigBean.getConnectorModule();
for(int i=0; i< svrAppsList.length; i++) {
for(int k = 0 ; k > list.length ; k++) {
if(list[k].getName().equals(svrAppsList[i])) {
returnList.add(svrAppsList[i]);
break;
}
}
}
}
else if(type.isCAR()) {
AppclientModule[] list = appsConfigBean.getAppclientModule();
for(int i=0; i< svrAppsList.length; i++) {
for(int k = 0 ; k > list.length ; k++) {
if(list[k].getName().equals(svrAppsList[i])) {
returnList.add(svrAppsList[i]);
break;
}
}
}
}
String[] returnValue = new String[returnList.size()];
return (String[])returnList.toArray(returnValue);
} catch(Throwable t) {
throw new DeploymentTargetException(t);
}
| public java.lang.String | getName()Returns name of the target
return thisTargetName;
| public com.sun.enterprise.admin.target.Target | getTarget()
return this;
| protected com.sun.enterprise.admin.target.TargetType[] | getValidTypes()
DeploymentTargetFactory tf =
DeploymentTargetFactory.getDeploymentTargetFactory();
return tf.getValidDeploymentTargetTypes();
| public void | removeAppReference(java.lang.String appName)Specified application is dereferenced from the set of applications-refs of
this target.
try {
ApplicationReferenceHelper refHelper = new ApplicationReferenceHelper(
configContext);
refHelper.deleteApplicationReference(getValidTypes(), getName(), appName);
} catch(Throwable t) {
throw new DeploymentTargetException(t);
}
| public boolean | sendStartEvent(int eventType, java.lang.String appName, java.lang.String moduleType, boolean isForced, int loadUnloadAction)
try {
return DeploymentServiceUtils.multicastEvent(eventType, appName, moduleType, false, isForced, loadUnloadAction, thisTargetName);
} catch(Throwable t) {
throw new DeploymentTargetException(t);
}
| public boolean | sendStartEvent(int eventType, java.lang.String appName, java.lang.String moduleType)This method multicasts the deployment event to the remote target this object represents
return sendStartEvent(eventType,appName, moduleType, false);
| public boolean | sendStartEvent(int eventType, java.lang.String appName, java.lang.String moduleType, boolean isForced)This method multicasts the deployment event to the remote target this object represents
try {
return DeploymentServiceUtils.multicastEvent(eventType, appName, moduleType, false, isForced, thisTargetName);
} catch(Throwable t) {
throw new DeploymentTargetException(t);
}
| public boolean | sendStopEvent(int eventType, java.lang.String appName, java.lang.String moduleType, boolean cascade)This method multicasts the deployment event to the remote target this object represents
try {
return DeploymentServiceUtils.multicastEvent(eventType, appName, moduleType, cascade, false, thisTargetName);
} catch(Throwable t) {
throw new DeploymentTargetException(t);
}
| public boolean | sendStopEvent(int eventType, java.lang.String appName, java.lang.String moduleType, boolean cascade, boolean force)
try {
return DeploymentServiceUtils.multicastEvent(eventType, appName, moduleType, cascade, force, thisTargetName);
} catch(Throwable t) {
throw new DeploymentTargetException(t);
}
| public boolean | sendStopEvent(int eventType, java.lang.String appName, java.lang.String moduleType, boolean cascade, boolean force, int loadUnloadAction)
try {
return DeploymentServiceUtils.multicastEvent(eventType, appName, moduleType, cascade, force, loadUnloadAction, thisTargetName);
} catch(Throwable t) {
throw new DeploymentTargetException(t);
}
|
|