本文整理了Java中com.sun.enterprise.config.serverbeans.Server.getResourceRef()
方法的一些代码示例,展示了Server.getResourceRef()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Server.getResourceRef()
方法的具体详情如下:
包路径:com.sun.enterprise.config.serverbeans.Server
类名称:Server
方法名:getResourceRef
暂无
代码示例来源:origin: org.glassfish.main.admin/config-api
@Override
public Object run(Server param) {
return param.getResourceRef().remove(ref);
}
}, server);
代码示例来源:origin: org.glassfish.admin/config-api
public Object run(Server param) {
return param.getResourceRef().remove(ref);
}
}, server);
代码示例来源:origin: org.glassfish.main.admin/config-api
public static ResourceRef getResourceRef(Server server, String refName) {
for (ResourceRef ref : server.getResourceRef()) {
if (ref.getRef().equals(refName)) {
return ref;
}
}
return null;
}
代码示例来源:origin: org.glassfish.admin/config-api
public static ResourceRef getResourceRef(Server server, String refName) {
for (ResourceRef ref : server.getResourceRef()) {
if (ref.getRef().equals(refName)) {
return ref;
}
}
return null;
}
代码示例来源:origin: org.glassfish.common/container-common
private List<ResourceRef> getResourceRefs() {
//Instead of injecting ResourceRef[] config array (which will inject all resource-refs in domain.xml
//including the ones in other server instances), get appropriate instance's resource-refs alone.
return domain.getServerNamed(environment.getInstanceName()).getResourceRef();
}
代码示例来源:origin: org.glassfish.main.resourcebase.resources/nucleus-resources
private List<ResourceRef> getResourceRefs() {
//Instead of injecting ResourceRef[] config array (which will inject all resource-refs in domain.xml
//including the ones in other server instances), get appropriate instance's resource-refs alone.
Server server = getServerBean();
List<ResourceRef> resourceRefs = new ArrayList<ResourceRef>(server.getResourceRef());
// MAC 10/2012 -- If not in cluster, add config refs
Config config = server.getConfig();
if (config != null) {
resourceRefs.addAll(config.getResourceRef());
}
return resourceRefs;
}
代码示例来源: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.resourcebase.resources/nucleus-resources
public boolean isBindableResourceEnabled(BindableResource br){
boolean resourceRefEnabled = false;
ResourceRef ref = getServer().getResourceRef(br.getJndiName());
if (ref != null) {
resourceRefEnabled = Boolean.valueOf(ref.getEnabled());
} else {
if(_logger.isLoggable(Level.FINE)) {
_logger.fine("ResourcesUtil :: isResourceReferenceEnabled null ref");
}
}
boolean resourceEnabled = Boolean.valueOf(br.getEnabled());
return resourceEnabled && resourceRefEnabled;
}
代码示例来源:origin: org.glassfish.main.common/amx-javaee
public void startListening()
{
// important: processResourceRef a listener *first* so that we don't miss anything
try
{
mMBeanServer.addNotificationListener(JMXUtil.getMBeanServerDelegateObjectName(), this, null, null);
}
catch (final JMException e)
{
throw new RuntimeException(e);
}
// register all existing
final List<ResourceRef> resourceRefs = mServer.getResourceRef();
for (final ResourceRef ref : resourceRefs)
{
processResourceRef(ref);
}
}
代码示例来源:origin: org.glassfish.main.jms/jms-admin
private List filterListForTarget(List<Map<String,String>> list){
List<Map<String,String>> resourceList = new ArrayList<>();
if (target != null){
List<ResourceRef> resourceRefs = null;
Cluster cluster = domain.getClusterNamed(target);
if (cluster != null) {
resourceRefs= cluster.getResourceRef();
} else {
Server server = domain.getServerNamed(target);
if (server != null) {
resourceRefs = server.getResourceRef();
}
}
if (resourceRefs != null && !resourceRefs.isEmpty()) {
for (Map<String,String> m : list) {
String jndiName = m.get("name");
for (ResourceRef resource : resourceRefs) {
if (jndiName.equals(resource.getRef())) {
resourceList.add(m);
}
}
}
}
}
return resourceList;
}
}
代码示例来源:origin: org.glassfish.main.jms/jms-admin
private boolean filterForTarget(String jndiName){
//List<String> resourceList = new ArrayList();
if (target != null){
List<ResourceRef> resourceRefs = null;
Cluster cluster = domain.getClusterNamed(target);
if (cluster != null)
resourceRefs= cluster.getResourceRef();
else {
Server server = domain.getServerNamed(target);
if (server != null)
resourceRefs = server.getResourceRef();
}
if (resourceRefs != null && resourceRefs.size() != 0){
for (ResourceRef resource : resourceRefs)
if(jndiName.equalsIgnoreCase(resource.getRef()))
return true;
}
}
return false;
}
代码示例来源:origin: org.glassfish.admin/admin-util
public Set<String> getTargetsReferringResourceRef(String refName) {
Set<String> targets = new HashSet<String>();
List<Server> servers = domain.getServers().getServer();
for(Server server: servers){
if(server.getResourceRef(refName) != null){
if(server.getCluster() != null){
targets.add(server.getCluster().getName());
}else if(server.isDas()){
targets.add(SystemPropertyConstants.DAS_SERVER_NAME);
}else if(server.isInstance()){
targets.add(server.getName());
}
}
}
return targets;
}
代码示例来源:origin: org.glassfish.common/container-common
private boolean isBindableResourceEnabled(String jndiName) {
boolean resourceEnabled = false;
BindableResource res = (BindableResource)
domain.getResources().getResourceByName(BindableResource.class, jndiName);
if(res != null){
resourceEnabled = Boolean.valueOf(res.getEnabled());
}
boolean refEnabled = false;
if(resourceEnabled){
ResourceRef ref = domain.getServerNamed(environment.getInstanceName()).getResourceRef(jndiName);
if(ref != null){
refEnabled = Boolean.valueOf(ref.getEnabled());
}
}
return resourceEnabled && refEnabled;
}
代码示例来源:origin: org.glassfish.main.resourcebase.resources/nucleus-resources
public Set<String> getTargetsReferringResourceRef(String refName) {
Set<String> targets = new HashSet<String>();
List<Server> servers = domain.getServers().getServer();
for(Server server: servers){
if(server.getResourceRef(refName) != null){
if(server.getCluster() != null){
targets.add(server.getCluster().getName());
}else if(server.isDas()){
targets.add(SystemPropertyConstants.DAS_SERVER_NAME);
}else if(server.isInstance()){
targets.add(server.getName());
}
}
}
return targets;
}
代码示例来源:origin: org.glassfish.connectors/connectors-runtime
ResourceRef ref = getServer().getResourceRef(resourceInfo.getName());
if (ref != null) {
enabled = ref.getEnabled();
代码示例来源:origin: org.glassfish.connectors/connectors-runtime
return Boolean.valueOf(bindableResource.getEnabled());
ResourceRef resRef = getServer().getResourceRef(
((BindableResource) resource).getJndiName());
return isEnabled((BindableResource) resource) &&
代码示例来源: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
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/admin-util
Server targetServer = ConfigBeansUtilities.getServerNamed(target);
if(targetServer != null){
List<ResourceRef> resourceRefs = targetServer.getResourceRef();
processResourceRefs(report, resourceRefs);
} else {
内容来源于网络,如有侵权,请联系作者删除!