org.glassfish.internal.api.Globals.getDefaultHabitat()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(95)

本文整理了Java中org.glassfish.internal.api.Globals.getDefaultHabitat()方法的一些代码示例,展示了Globals.getDefaultHabitat()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Globals.getDefaultHabitat()方法的具体详情如下:
包路径:org.glassfish.internal.api.Globals
类名称:Globals
方法名:getDefaultHabitat

Globals.getDefaultHabitat介绍

暂无

代码示例

代码示例来源:origin: org.glassfish.main.security/security-ee

public void initialize(Object service) throws IOException {
if (service == null && Globals.getDefaultHabitat() != null) {
  service = Globals.getDefaultHabitat().getService(SecurityService.class,
        ServerEnvironment.DEFAULT_INSTANCE_NAME);
}
if (service instanceof SecurityService) {
  processServerConfig((SecurityService) service,configMap);
} /*else {
    throw new IOException("invalid configBean type passed to parser");
}*/
}

代码示例来源:origin: org.glassfish.main.common/amx-core

public static RealmsManager
getRealmsManager()
{
  final RealmsManager mgr = Globals.getDefaultHabitat().getService(RealmsManager.class);
  return mgr;
}

代码示例来源:origin: org.glassfish.webservices/jsr109-impl

public WebServiceContextImpl() {
  if (Globals.getDefaultHabitat() != null) {
    secServ = Globals.get(org.glassfish.webservices.SecurityService.class);
  }
}

代码示例来源:origin: org.glassfish.main.transaction/jta

/** 
   * Return instance with all injected values from deserialization if possible
   */
  Object readResolve() throws ObjectStreamException {
    ServiceLocator h = Globals.getDefaultHabitat();
    if (h != null) {
      return h.getService(UserTransactionImpl.class);
    }

    return this;
  }
}

代码示例来源:origin: org.glassfish.webservices/jsr109-impl

public EjbWebServiceServlet() {
  super();
  if (org.glassfish.internal.api.Globals.getDefaultHabitat() != null) {
    secServ = org.glassfish.internal.api.Globals.get(SecurityService.class);
  }
}

代码示例来源:origin: org.glassfish.deployment/dol

/**
* @return the descriptor instance to associate with this XMLNode
*/    
public Application getDescriptor() {
  if (descriptor==null) {
    descriptor = new Application(Globals.getDefaultHabitat());
  }
  return descriptor;
}

代码示例来源:origin: org.glassfish.security/security

private static synchronized  RealmsManager _getRealmsManager() {
  if (realmsManager.get() == null) {
    if(Globals.getDefaultHabitat() != null) {
      realmsManager = new WeakReference<RealmsManager>(Globals.get(RealmsManager.class));
    }
    else {
      return null;
    }
  }
  return realmsManager.get();
}

代码示例来源:origin: eclipse-ee4j/glassfish

private synchronized static PasswordAliasStore getDomainPasswordAliasStore() {
  if (domainPasswordAliasStore == null) {
    domainPasswordAliasStore = Globals.getDefaultHabitat().getService(DomainScopedPasswordAliasStore.class);
  }
  return domainPasswordAliasStore;
}

代码示例来源:origin: org.glassfish.main.ejb/ejb-container

public AbstractEjbHandler() {
  ServiceLocator h = Globals.getDefaultHabitat();
  if( h != null ) {
    provider = h.getService(AnnotationTypesProvider.class, "EJB");
  }
}
/**

代码示例来源:origin: org.glassfish.ejb/ejb-container

public AbstractEjbHandler() {
  Habitat h = Globals.getDefaultHabitat();
  if( h != null ) {
    provider = h.getComponent(AnnotationTypesProvider.class, "EJB");
  }
}
/**

代码示例来源:origin: org.glassfish.main.security/security

private void initSSLUtils() {
    if (sslUtils == null) {
      if (Globals.getDefaultHabitat() != null) {
        sslUtils = Globals.getDefaultHabitat().getService(SSLUtils.class);
      } else {
        sslUtils = new SSLUtils();
        sslUtils.postConstruct();
      }
    }
  }
}

代码示例来源:origin: org.glassfish.security/realms

/**
 * Returns the names of accessible realms.
 * @return set of realm names
 */
public static Enumeration	getRealmNames() {
  Habitat habitat = Globals.getDefaultHabitat();
  RealmsManager mgr = habitat.getComponent(RealmsManager.class);
  if (mgr != null) {
    return mgr.getRealmNames();
  }
  throw new RuntimeException("Unable to locate RealmsManager Service");
}

代码示例来源:origin: org.glassfish.deployment/dol

public String getProtocolBinding() {
  WSDolSupport dolSupport = Globals.getDefaultHabitat().getComponent(WSDolSupport.class);
  if (protocolBinding==null) {
    if (dolSupport!=null) {
      protocolBinding =  dolSupport.getProtocolBinding(null);
    }
  }
  return protocolBinding;
}

代码示例来源:origin: org.glassfish.deployment/dol

public String getSoapAddressPrefix() {
  WSDolSupport dolSupport = Globals.getDefaultHabitat().getComponent(WSDolSupport.class);
  if (dolSupport!=null) {
    return dolSupport.getSoapAddressPrefix(protocolBinding);
  }
  // anything else should be soap11
  return "so`ap";
}

代码示例来源:origin: org.glassfish.security/security

RoleMapper(String appName) {
  this.appName = appName;
  secService = Globals.getDefaultHabitat().getComponent(SecurityService.class);
  defaultP2RMappingClassName = getDefaultP2RMappingClassName();
  postConstruct();
}

代码示例来源:origin: org.glassfish.main.security/security-ee

RoleMapper(String appName) {
  this.appName = appName;
  secService = Globals.getDefaultHabitat().getService(SecurityService.class,
      ServerEnvironment.DEFAULT_INSTANCE_NAME);
  defaultP2RMappingClassName = getDefaultP2RMappingClassName();
  postConstruct();
}

代码示例来源:origin: org.glassfish.common/container-common

private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
  stream.defaultReadObject();
  //Initialize the transients that were passed at ctor.
  Habitat defaultHabitat = Globals.getDefaultHabitat();
  txManager     = defaultHabitat.getByContract(TransactionManager.class);
  invMgr        = defaultHabitat.getByContract(InvocationManager.class);
  compEnvMgr    = defaultHabitat.getByContract(ComponentEnvManager.class);
  callFlowAgent = defaultHabitat.getByContract(CallFlowAgent.class);
}

代码示例来源:origin: org.glassfish.webservices/jsr109-impl

public ServletWebServiceDelegate (ServletDelegate firstDelegate) {
  rpcDelegate_ = firstDelegate;
  rpcFactory_ = JaxRpcObjectFactory.newInstance();
  wsEngine_ = WebServiceEngineImpl.getInstance();
  if (Globals.getDefaultHabitat() != null) {
    secServ = Globals.get(org.glassfish.webservices.SecurityService.class);
  }
}

代码示例来源:origin: org.glassfish.ejb/ejb-container

/**
 * Do all ProtocolManager access lazily and only request orb if it has already been
 * initialized so that code doesn't make the assumption that an orb is available in
 * this runtime.
 */
private ProtocolManager getProtocolManager() {
GlassFishORBHelper orbHelper = Globals.getDefaultHabitat().getComponent(GlassFishORBHelper.class);
return orbHelper.isORBInitialized() ? orbHelper.getProtocolManager() : null;
}

代码示例来源:origin: org.glassfish.main.security/security-ee

public ContainerCallbackHandler() {
  if (Globals.getDefaultHabitat() == null || SecurityServicesUtil.getInstance().isACC()) {
    handler = new ClientContainerCallbackHandler();
  } else {
    handler = new ServerContainerCallbackHandler();
  }
}

相关文章