本文整理匯總了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);
}
}