本文整理了Java中com.sun.enterprise.config.serverbeans.Server.createChild()
方法的一些代码示例,展示了Server.createChild()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Server.createChild()
方法的具体详情如下:
包路径:com.sun.enterprise.config.serverbeans.Server
类名称:Server
方法名:createChild
暂无
代码示例来源:origin: org.glassfish.main.admin/config-api
@Override
public Object run(Server param) throws PropertyVetoException, TransactionFailure {
ResourceRef newResourceRef = param.createChild(ResourceRef.class);
newResourceRef.setEnabled(enabled);
newResourceRef.setRef(refName);
param.getResourceRef().add(newResourceRef);
return newResourceRef;
}
}, server);
代码示例来源:origin: org.glassfish.admin/config-api
public Object run(Server param) throws PropertyVetoException, TransactionFailure {
ResourceRef newResourceRef = param.createChild(ResourceRef.class);
newResourceRef.setEnabled(enabled);
newResourceRef.setRef(refName);
param.getResourceRef().add(newResourceRef);
return newResourceRef;
}
}, server);
代码示例来源:origin: org.glassfish.main.admin/config-api
private void changeSystemProperty(List<SystemProperty> sps, String name, String port) throws PropertyVetoException, TransactionFailure {
for (SystemProperty sp : sps) {
if (name.equals(sp.getName())) {
sp.setValue(port);
return;
}
}
// does not exist -- let's add one!
SystemProperty sp = newServer.createChild(SystemProperty.class);
sp.setName(name);
sp.setValue(port);
sps.add(sp);
}
代码示例来源:origin: org.glassfish.admin/config-api
private void changeSystemProperty(List<SystemProperty> sps, String name, String port) throws PropertyVetoException, TransactionFailure {
for (SystemProperty sp : sps) {
if (name.equals(sp.getName())) {
sp.setValue(port);
return;
}
}
// does not exist -- let's add one!
SystemProperty sp = newServer.createChild(SystemProperty.class);
sp.setName(name);
sp.setValue(port);
sps.add(sp);
}
代码示例来源:origin: org.glassfish.admin/config-api
private void setSystemProperty(String name, String value) throws TransactionFailure, PropertyVetoException {
SystemProperty sp = _server.getSystemProperty(name);
if (sp == null) {
SystemProperty newSP = _server.createChild(SystemProperty.class);
newSP.setName(name);
newSP.setValue(value);
_server.getSystemProperty().add(newSP);
} else {
//Don't change the system property if it already exists - leave the original port assignment
//sp.setName(name);
//sp.setValue(value);
}
}
代码示例来源:origin: org.glassfish.main.admin/config-api
private void setSystemProperty(String name, String value) throws TransactionFailure, PropertyVetoException {
SystemProperty sp = _server.getSystemProperty(name);
if (sp == null) {
SystemProperty newSP = _server.createChild(SystemProperty.class);
newSP.setName(name);
newSP.setValue(value);
_server.getSystemProperty().add(newSP);
} else {
//Don't change the system property if it already exists - leave the original port assignment
//sp.setName(name);
//sp.setValue(value);
}
}
代码示例来源:origin: org.glassfish.cluster/cluster-admin
final String propName = (String) entry.getKey();
final String propValue = (String) entry.getValue();
SystemProperty newSP = newServer.createChild(SystemProperty.class);
代码示例来源:origin: org.glassfish.main.cluster/cluster-admin
final String propName = (String) entry.getKey();
final String propValue = (String) entry.getValue();
SystemProperty newSP = newServer.createChild(SystemProperty.class);
代码示例来源:origin: org.glassfish.main.core/kernel
Server s = (Server) proxies[1];
List<ApplicationRef> arefs = s.getApplicationRef();
ApplicationRef aref = s.createChild(ApplicationRef.class);
aref.setRef(app.getName());
aref.setEnabled(Boolean.TRUE.toString());
代码示例来源:origin: org.glassfish.admin/config-api
private void addClusterRefs(Cluster cluster, Server instance) throws TransactionFailure, PropertyVetoException {
if (cluster != null) {
for (ApplicationRef appRef : cluster.getApplicationRef()) {
if (instance.getApplicationRef(appRef.getRef()) == null) {
ApplicationRef newAppRef = instance.createChild(ApplicationRef.class);
newAppRef.setRef(appRef.getRef());
newAppRef.setDisableTimeoutInMinutes(appRef.getDisableTimeoutInMinutes());
newAppRef.setEnabled(appRef.getEnabled());
newAppRef.setLbEnabled(appRef.getLbEnabled());
newAppRef.setVirtualServers(appRef.getVirtualServers());
instance.getApplicationRef().add(newAppRef);
}
}
for (ResourceRef rr : cluster.getResourceRef()) {
if (instance.getResourceRef(rr.getRef()) == null) {
ResourceRef newRR = instance.createChild(ResourceRef.class);
newRR.setRef(rr.getRef());
newRR.setEnabled(rr.getEnabled());
instance.getResourceRef().add(newRR);
}
}
}
}
}
代码示例来源:origin: org.glassfish.main.admin/config-api
private void addClusterRefs(Cluster cluster, Server instance) throws TransactionFailure, PropertyVetoException {
if (cluster != null) {
for (ApplicationRef appRef : cluster.getApplicationRef()) {
if (instance.getApplicationRef(appRef.getRef()) == null) {
ApplicationRef newAppRef = instance.createChild(ApplicationRef.class);
newAppRef.setRef(appRef.getRef());
newAppRef.setDisableTimeoutInMinutes(appRef.getDisableTimeoutInMinutes());
newAppRef.setEnabled(appRef.getEnabled());
newAppRef.setLbEnabled(appRef.getLbEnabled());
newAppRef.setVirtualServers(appRef.getVirtualServers());
instance.getApplicationRef().add(newAppRef);
}
}
for (ResourceRef rr : cluster.getResourceRef()) {
if (instance.getResourceRef(rr.getRef()) == null) {
ResourceRef newRR = instance.createChild(ResourceRef.class);
newRR.setRef(rr.getRef());
newRR.setEnabled(rr.getEnabled());
instance.getResourceRef().add(newRR);
}
}
}
}
}
代码示例来源:origin: org.glassfish.admin/config-api
throw new TransactionFailure("Cannot add un-named resources to the new server instance");
ResourceRef newResourceRef = instance.createChild(ResourceRef.class);
newResourceRef.setRef(name);
instance.getResourceRef().add(newResourceRef);
ApplicationRef newAppRef = instance.createChild(ApplicationRef.class);
newAppRef.setRef(application.getName());
代码示例来源:origin: org.glassfish.main.admin/config-api
if (dasGmsPortProp != null) {
SystemProperty gmsListenerPortProp =
instance.createChild(SystemProperty.class);
gmsListenerPortProp.setName(propName);
gmsListenerPortProp.setValue(dasGmsPortProp.getValue());
throw new TransactionFailure("Cannot add un-named resources to the new server instance");
ResourceRef newResourceRef = instance.createChild(ResourceRef.class);
newResourceRef.setRef(name);
instance.getResourceRef().add(newResourceRef);
ApplicationRef newAppRef = instance.createChild(ApplicationRef.class);
newAppRef.setRef(application.getName());
内容来源于网络,如有侵权,请联系作者删除!