org.jboss.util.naming.Util.lookup()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(149)

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

Util.lookup介绍

[英]Lookup an object in the default initial context
[中]在默认初始上下文中查找对象

代码示例

代码示例来源:origin: org.jboss.jbossas/jboss-as-connector

/**
* Get the jms provider
* 
* @throws Exception for any error
*/
protected void setupJMSProviderAdapter() throws Exception
{
 String providerAdapterJNDI = spec.getProviderAdapterJNDI();
 if (providerAdapterJNDI.startsWith("java:") == false)
   providerAdapterJNDI = "java:" + providerAdapterJNDI;
 log.debug("Retrieving the jms provider adapter " + providerAdapterJNDI + " for " + this);
 adapter = (JMSProviderAdapter) Util.lookup(providerAdapterJNDI, JMSProviderAdapter.class);
 log.debug("Using jms provider adapter " + adapter + " for " + this);
}

代码示例来源:origin: org.jboss.snowdrop/snowdrop-deployers-core

/**
 * Do a jndi lookup for bean factory.
 *
 * @param name the jndi name
 * @return bean factory instance
 * @throws Exception for any exception
 */
protected T lookup(String name) throws Exception {
  Class<T> beanFactoryClass = getExactBeanFactoryClass();
  T beanFactory = beanFactoryClass.cast(Util.lookup(name, beanFactoryClass));
  if (log.isTraceEnabled()) {
    log.trace("Found Spring bean factory [" + name + "]: " + beanFactory);
  }
  return beanFactory;
}

代码示例来源:origin: org.jboss/jboss-common-core

/**
* Lookup an object in the default initial context
* 
* @param name the name to lookup
* @param clazz the expected type
* @return the object
* @throws Exception for any error
*/
public static Object lookup(String name, Class<?> clazz) throws Exception
{
 InitialContext ctx = new InitialContext();
 try
 {
   return lookup(ctx, name, clazz);
 }
 finally
 {
   ctx.close();
 }
}

代码示例来源:origin: org.jboss/jboss-common-core

/**
* Lookup an object in the default initial context
* 
* @param name the name to lookup
* @param clazz the expected type
* @return the object
* @throws Exception for any error
*/
public static Object lookup(Name name, Class<?> clazz) throws Exception
{
 InitialContext ctx = new InitialContext();
 try
 {
   return lookup(ctx, name, clazz);
 }
 finally
 {
   ctx.close();
 }
}

代码示例来源:origin: org.jboss.jbossas/jboss-as-server

providerAdapterJNDI = "java:" + providerAdapterJNDI;
Context ctx = new InitialContext();
JMSProviderAdapter adapter = (JMSProviderAdapter) Util.lookup(providerAdapterJNDI, JMSProviderAdapter.class);
try
  return (XAConnectionFactory) Util.lookup(ctx, connectionFactoryRef, XAConnectionFactory.class);

代码示例来源:origin: org.jboss.jbossas/jboss-as-connector

/**
* Setup the DLQ Destination
* 
* @param ctx the naming context
* @throws Exception for any error
*/
protected void setupDLQDestination(Context ctx) throws Exception
{
 String name = activation.getActivationSpec().getDLQJNDIName();
 dlq = (Queue) Util.lookup(ctx, name, Queue.class);
}

代码示例来源:origin: org.jboss.jbossas/jboss-as-connector

destination = (Destination) Util.lookup(ctx, destinationName, destinationType);
log.debug("Retrieving destination " + destinationName + " of type " + Destination.class.getName());
destination = (Destination) Util.lookup(ctx, destinationName, Destination.class);
if (destination instanceof Topic)

代码示例来源:origin: org.jboss.snowdrop/snowdrop-deployers-core

String parentName = pbfm.group(1);
try {
  this.setParentBeanFactory((BeanFactory) Util.lookup(parentName, BeanFactory.class));
} catch (Exception e) {
  throw new BeanDefinitionStoreException("Failure during parent bean factory JNDI lookup: " + parentName, e);

代码示例来源:origin: org.jboss.snowdrop/snowdrop-deployers-core

String parentName = pbfm.group(1);
try {
  this.getBeanFactory().setParentBeanFactory((BeanFactory) Util.lookup(parentName, BeanFactory.class));
} catch (Exception e) {
  throw new BeanDefinitionStoreException("Failure during parent bean factory JNDI lookup: " + parentName, e);

代码示例来源:origin: org.jboss.jbossas/jboss-as-connector

QueueConnectionFactory qcf = (QueueConnectionFactory) Util.lookup(ctx, queueFactoryRef, QueueConnectionFactory.class);
log.debug("Got queue connection factory " + qcf + " from " + queueFactoryRef);
log.debug("Attempting to create queue connection with user " + user);

代码示例来源:origin: org.jboss.jbossas/jboss-as-connector

TopicConnectionFactory tcf = (TopicConnectionFactory) Util.lookup(ctx, topicFactoryRef, TopicConnectionFactory.class);
log.debug("Got topic connection factory " + tcf + " from " + topicFactoryRef);
log.debug("Attempting to create topic connection with user " + user);

代码示例来源:origin: org.jboss.jbossas/jboss-as-connector

String queueFactoryRef = adapter.getQueueFactoryRef();
log.debug("Attempting to lookup dlq connection factory " + queueFactoryRef);
QueueConnectionFactory qcf = (QueueConnectionFactory) Util.lookup(ctx, queueFactoryRef, QueueConnectionFactory.class);
log.debug("Got dlq connection factory " + qcf + " from " + queueFactoryRef);
log.debug("Attempting to create queue connection with user " + user);

相关文章