本文整理匯總了Java中org.jboss.forge.furnace.spi.ExportedInstance.get方法的典型用法代碼示例。如果您正苦於以下問題:Java ExportedInstance.get方法的具體用法?Java ExportedInstance.get怎麽用?Java ExportedInstance.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jboss.forge.furnace.spi.ExportedInstance
的用法示例。
在下文中一共展示了ExportedInstance.get方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: get
import org.jboss.forge.furnace.spi.ExportedInstance; //導入方法依賴的package包/類
@Override
public T get()
{
if (isAmbiguous())
throw new IllegalStateException("Cannot resolve Ambiguous dependencies: " + toString());
ExportedInstance<T> exported = getExportedInstance();
if (exported != null)
{
T instance = exported.get();
instanceMap.put(instance, exported);
return instance;
}
else
throw new ContainerException("No services of type [" + typeName + "] could be found in any started addons.");
}
示例2: selectExact
import org.jboss.forge.furnace.spi.ExportedInstance; //導入方法依賴的package包/類
@Override
public T selectExact(Class<T> type)
{
Assert.notNull(type, "Type to select must not be null.");
Set<ExportedInstance<T>> instances = getExportedInstances();
for (ExportedInstance<T> instance : instances)
{
if (type.equals(instance.getActualType()))
{
T result = instance.get();
instanceMap.put(result, instance);
return result;
}
}
throw new ContainerException("No services of type [" + type + "] could be found in any started addons.");
}
示例3: fireEvent
import org.jboss.forge.furnace.spi.ExportedInstance; //導入方法依賴的package包/類
@Override
public void fireEvent(Object event, Annotation... qualifiers) throws EventException
{
ServiceRegistry registry = addon.getServiceRegistry();
ExportedInstance<EventManager> instance = registry.getExportedInstance(EventManager.class);
if (instance != null)
{
EventManager manager = instance.get();
manager.fireEvent(event, qualifiers);
instance.release(manager);
}
}
示例4: next
import org.jboss.forge.furnace.spi.ExportedInstance; //導入方法依賴的package包/類
@Override
public T next()
{
ExportedInstance<T> exported = iterator.next();
T instance = exported.get();
imported.instanceMap.put(instance, exported);
return instance;
}