本文整理汇总了Java中javax.enterprise.inject.Disposes类的典型用法代码示例。如果您正苦于以下问题:Java Disposes类的具体用法?Java Disposes怎么用?Java Disposes使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Disposes类属于javax.enterprise.inject包,在下文中一共展示了Disposes类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validateDisposeMethods
import javax.enterprise.inject.Disposes; //导入依赖的package包/类
private static void validateDisposeMethods(final CdiEjbBean<?> bean) {
if (!bean.getBeanContext().isLocalbean()) {
for (final Method m : bean.getBeanContext().getBeanClass().getMethods()) {
if (m.getDeclaringClass().equals(Object.class)) {
continue;
}
if (m.getParameterTypes().length > 0) {
for (final Annotation[] a : m.getParameterAnnotations()) {
for (final Annotation ann : a) {
if (ann.annotationType().equals(Disposes.class) && doResolveViewMethod(bean, m) == null) {
throw new WebBeansConfigurationException("@Disposes is forbidden on non business EJB methods");
}
}
}
}
}
}
}
示例2: closeInputStream
import javax.enterprise.inject.Disposes; //导入依赖的package包/类
public void closeInputStream(@Disposes
@InjectableResource(resourceProvider = InjectableResourceProvider.class, location = "")
InputStream inputStream)
{
if (inputStream != null)
{
try
{
inputStream.close();
}
catch (IOException e)
{
if (logger.isLoggable(Level.FINE))
{
logger.log(Level.FINE,"Unable to close input stream ",e);
}
}
}
}
示例3: dispose
import javax.enterprise.inject.Disposes; //导入依赖的package包/类
/**
*
* @param scheduler
*/
public void dispose(@Disposes ScheduledExecutorService scheduler) {
scheduler.shutdown();
try {
if (!scheduler.awaitTermination(1, TimeUnit.MINUTES)) {
this.log.warn("Shutdown did not complete in time!");
}
} catch (InterruptedException e) {
this.log.warn("Shutdown interrupted!", e);
Thread.currentThread().interrupt();
}
}
示例4: destroy
import javax.enterprise.inject.Disposes; //导入依赖的package包/类
/**
* Shuts down the MQTT client.
*
* @param client
* client to shut down.
*/
public void destroy(@Disposes MqttClient client) {
try {
if (client != null) {
client.disconnect();
logger.info("Disconnected from broker: " + broker);
}
} catch (MqttException e) {
logger.error("Error disconnecting", e);
}
}
示例5: closeAnalysisKeyspaceSession
import javax.enterprise.inject.Disposes; //导入依赖的package包/类
public void closeAnalysisKeyspaceSession(@Disposes FileSystem session) {
try {
session.close();
} catch (IOException e) {
logger.warn("Could not close Hadoop file system.", e);
}
}
示例6: closeDuctileGraph
import javax.enterprise.inject.Disposes; //导入依赖的package包/类
public void closeDuctileGraph(@Disposes DuctileGraph ductileGraph) {
try {
ductileGraph.close();
} catch (IOException e) {
logger.warn("Could not close Ductile Graph.", e);
}
}
示例7: closeAnalysisKeyspaceSession
import javax.enterprise.inject.Disposes; //导入依赖的package包/类
public void closeAnalysisKeyspaceSession(@Disposes @EvaluatorStoreConnection Connection connection) {
try {
connection.close();
} catch (SQLException e) {
logger.warn("Could not close connection to Phoenix/HBase.", e);
}
}
示例8: closeAnalysisKeyspaceSession
import javax.enterprise.inject.Disposes; //导入依赖的package包/类
public void closeAnalysisKeyspaceSession(@Disposes @AnalysisServiceConnection Connection connection) {
try {
connection.close();
} catch (SQLException e) {
logger.warn("Could not close connection to Phoenix/HBase.", e);
}
}
示例9: closePreferencesStoreSession
import javax.enterprise.inject.Disposes; //导入依赖的package包/类
public void closePreferencesStoreSession(@Disposes @PreferencesStoreConnection Connection connection) {
try {
connection.close();
} catch (SQLException e) {
logger.warn("Could not close connection to Phoenix/HBase.", e);
}
}
示例10: closeAnalysisKeyspaceSession
import javax.enterprise.inject.Disposes; //导入依赖的package包/类
public void closeAnalysisKeyspaceSession(@Disposes @PluginsDatabaseConnection Connection connection) {
try {
connection.close();
} catch (SQLException e) {
logger.warn("Could not close connection to Phoenix/HBase.", e);
}
}
示例11: closeAnalysisKeyspaceSession
import javax.enterprise.inject.Disposes; //导入依赖的package包/类
public void closeAnalysisKeyspaceSession(@Disposes @AccountManagerConnection Connection connection) {
try {
connection.close();
} catch (SQLException e) {
logger.warn("Could not close connection to Phoenix/HBase.", e);
}
}
示例12: closeAnalysisKeyspaceSession
import javax.enterprise.inject.Disposes; //导入依赖的package包/类
public void closeAnalysisKeyspaceSession(@Disposes @PasswordStoreConnection Connection connection) {
try {
connection.close();
} catch (SQLException e) {
logger.warn("Could not close connection to Phoenix/HBase.", e);
}
}
示例13: closeAnalysisKeyspaceSession
import javax.enterprise.inject.Disposes; //导入依赖的package包/类
public void closeAnalysisKeyspaceSession(@Disposes @SystemMonitorConnection Connection connection) {
try {
connection.close();
} catch (SQLException e) {
logger.warn("Could not close connection to Phoenix/HBase.", e);
}
}
示例14: closeAnalysisKeyspaceSession
import javax.enterprise.inject.Disposes; //导入依赖的package包/类
public void closeAnalysisKeyspaceSession(
@Disposes @IntermediateCoCoMoEvaluatorStoreConnection Connection connection) {
try {
connection.close();
} catch (SQLException e) {
logger.warn("Could not close connection to Phoenix/HBase.", e);
}
}
示例15: closeAnalysisKeyspaceSession
import javax.enterprise.inject.Disposes; //导入依赖的package包/类
public void closeAnalysisKeyspaceSession(@Disposes @BasicCoCoMoEvaluatorStoreConnection Connection connection) {
try {
connection.close();
} catch (SQLException e) {
logger.warn("Could not close connection to Phoenix/HBase.", e);
}
}