當前位置: 首頁>>代碼示例>>Java>>正文


Java Disposes類代碼示例

本文整理匯總了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");
                        }
                    }
                }
            }
        }
    }
}
 
開發者ID:apache,項目名稱:tomee,代碼行數:20,代碼來源:CdiPlugin.java

示例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);
            }
        }
    }
}
 
開發者ID:apache,項目名稱:deltaspike,代碼行數:20,代碼來源:InjectableResourceProducer.java

示例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();
	}
}
 
開發者ID:dansiviter,項目名稱:cito,代碼行數:16,代碼來源:SchedulerProducer.java

示例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);
    }
}
 
開發者ID:zambrovski,項目名稱:mqtt-camunda-bpm,代碼行數:17,代碼來源:MqttClientProducer.java

示例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);
}
   }
 
開發者ID:PureSolTechnologies,項目名稱:Purifinity,代碼行數:8,代碼來源:FileSystemProducter.java

示例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);
}
   }
 
開發者ID:PureSolTechnologies,項目名稱:Purifinity,代碼行數:8,代碼來源:DuctileGraphProducer.java

示例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);
}
   }
 
開發者ID:PureSolTechnologies,項目名稱:Purifinity,代碼行數:8,代碼來源:EvaluatorStoreConnectionProducer.java

示例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);
}
   }
 
開發者ID:PureSolTechnologies,項目名稱:Purifinity,代碼行數:8,代碼來源:AnalysisServiceConnectionProducer.java

示例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);
}
   }
 
開發者ID:PureSolTechnologies,項目名稱:Purifinity,代碼行數:8,代碼來源:PreferencesStoreConnectionProducer.java

示例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);
}
   }
 
開發者ID:PureSolTechnologies,項目名稱:Purifinity,代碼行數:8,代碼來源:PluginsDatabaseConnectionProducer.java

示例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);
}
   }
 
開發者ID:PureSolTechnologies,項目名稱:Purifinity,代碼行數:8,代碼來源:AccountManagerConnectionProducer.java

示例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);
}
   }
 
開發者ID:PureSolTechnologies,項目名稱:Purifinity,代碼行數:8,代碼來源:PasswordStoreConnectionProducer.java

示例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);
}
   }
 
開發者ID:PureSolTechnologies,項目名稱:Purifinity,代碼行數:8,代碼來源:SystemMonitorConnectionProducer.java

示例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);
}
   }
 
開發者ID:PureSolTechnologies,項目名稱:Purifinity,代碼行數:9,代碼來源:ConnectionProducer.java

示例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);
}
   }
 
開發者ID:PureSolTechnologies,項目名稱:Purifinity,代碼行數:8,代碼來源:ConnectionProducer.java


注:本文中的javax.enterprise.inject.Disposes類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。