本文整理汇总了Java中atg.nucleus.Nucleus类的典型用法代码示例。如果您正苦于以下问题:Java Nucleus类的具体用法?Java Nucleus怎么用?Java Nucleus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Nucleus类属于atg.nucleus包,在下文中一共展示了Nucleus类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getPropertyValue
import atg.nucleus.Nucleus; //导入依赖的package包/类
/**
* Returns the value of the underlying property.
*
* @param pItem
* the RepositoryItem to retrieve the value from
* @param pValue
* the value to retrieve
* @return The property value requested
*/
public Object getPropertyValue(final RepositoryItemImpl pItem, final Object pValue) {
// If the object value is null or "the null object", then simply return
// null.
if ((pValue == null) || pValue == RepositoryItemImpl.NULL_OBJECT) {
return null;
}
if (isEncryptOnly()) {
return super.getPropertyValue(pItem, pValue);
} else {
CryptoEngine cryptoEngine = (CryptoEngine) Nucleus.getGlobalNucleus().resolveName(this.mCryptoEngineName);
if (cryptoEngine == null) {
logError("Property Item Descriptor: " + getItemDescriptor().getItemDescriptorName() + "." + getName()
+ " not property configured.");
throw new NullPointerException("Crypto Engine not configured "
+ getItemDescriptor().getItemDescriptorName() + "." + this.getName());
}
try {
return super.getPropertyValue(pItem, cryptoEngine.decrypt(pValue.toString()));
} catch (Exception e) {
return super.getPropertyValue(pItem, pValue);
}
}
}
开发者ID:sparkred-insight,项目名称:ATGCrypto,代码行数:33,代码来源:CryptoPropertyDescriptor.java
示例2: wrapForNameResolution
import atg.nucleus.Nucleus; //导入依赖的package包/类
/**
* Wrap the specified request, and configure minimally for name
* resolution. This method does not create a
* TestingDynamoHttpServletRequest, but is instead intended for
* either wrapping native appserver requests, or other externally
* created requests (such as cactus).
*
* @param pRequest
* the request to wrap.
* @param pNucleus
* the Nucleus to use for name resolutions
* on the request.
*
* @return the DynamoHttpServletRequest wrapping pRequest
*/
public DynamoHttpServletRequest wrapForNameResolution(HttpServletRequest pRequest,
Nucleus pNucleus) {
if (pRequest instanceof DynamoHttpServletRequest) {
throw new IllegalArgumentException(
"Cannot wrap a DynamoHttpServletRequest with another."
);
}
DynamoHttpServletRequest dynRequest = new DynamoHttpServletRequest();
dynRequest.setRequest(pRequest);
setExternalComponentsOnRequest(pNucleus, dynRequest);
return dynRequest;
}
开发者ID:jvz,项目名称:dynunit,代码行数:31,代码来源:ServletTestUtils.java
示例3: overrideLogListeners
import atg.nucleus.Nucleus; //导入依赖的package包/类
public static void overrideLogListeners(GenericService service, List<String> listenerPaths) {
if (listenerPaths == null || listenerPaths.isEmpty()) {
if (service.isLoggingWarning()) {
service.logWarning("Can not override log listeners as no override value has been set");
}
return;
}
if (service.isLoggingInfo()) {
service.logInfo("Overriding logging queue");
}
LogListener [] currentListeners = service.getLogListeners();
if (currentListeners != null) {
for (int i = currentListeners.length - 1; i >= 0; i--) {
service.removeLogListener(currentListeners[i]);
}
if (service.isLoggingInfo()) {
service.logInfo("Log listeners have been overriden");
}
}
for (String path: listenerPaths) {
LogListener l = (LogListener)Nucleus.getGlobalNucleus().resolveName(path);
if (l != null) {
service.addLogListener(l);
} else {
if (service.isLoggingError()) {
service.vlogError("Could not resolve service with path {}", path);
}
}
}
}
开发者ID:vrakoton,项目名称:ATG11Extensions,代码行数:35,代码来源:LogListenerQueueUtil.java
示例4: doStartService
import atg.nucleus.Nucleus; //导入依赖的package包/类
/**
* Initializes the service by transforming the map of url to Nucleus service path
* to a map where keys are urls and the value is a Nucleus object by invoking the
* Nucleus service name resolution method.
*/
public void doStartService() throws ServiceException
{
super.doStartService();
if (getUrlToRequestCheckerPathMap() != null && !getUrlToRequestCheckerPathMap().isEmpty()) {
if (mUrlToRequestCheckerMap == null) {
mUrlToRequestCheckerMap = new HashMap<String, RequestCheckerService>();
}
for (String url : getUrlToRequestCheckerPathMap().keySet()) {
final RequestCheckerService checker = (RequestCheckerService)Nucleus.getGlobalNucleus().resolveName(getUrlToRequestCheckerPathMap().get(url));
if (checker != null) {
mUrlToRequestCheckerMap.put(url, checker);
} else {
if (isLoggingError()) {
logError("Could not resolve a component with path: " + getUrlToRequestCheckerPathMap().get(url));
}
}
}
}
}
开发者ID:vrakoton,项目名称:ATG11Extensions,代码行数:26,代码来源:AdminPathSecurityServlet.java
示例5: doStartNucleus
import atg.nucleus.Nucleus; //导入依赖的package包/类
private static Nucleus doStartNucleus(List<String> moduleList, boolean isUseTestConfigLayer, Class<?> testClass) throws Throwable {
// Fire up Nucleus - make sure DYNAMO_HOME and DUST_HOME are set.
String initialComponent = "/atg/dynamo/Configuration";
NucleusStartupOptions startupOptions = null;
// Make sure to get the testConfigDir, before adding TDD.Core to the front of the module list.
String testConfigDir=getTestConfigPath(moduleList);
if(isUseTestConfigLayer){
startupOptions = new NucleusStartupOptions(moduleList.toArray(new String[0]), testClass, testConfigDir, initialComponent);
} else {
startupOptions = new NucleusStartupOptions(moduleList.toArray(new String[0]), testClass, initialComponent);
}
Nucleus nucleus = NucleusTestUtils.startNucleusWithModules(startupOptions);
if (null == nucleus) {
throw new Exception("Unable to start Nucleus for unit tests.");
}
return nucleus;
}
开发者ID:Roanis,项目名称:atg-tdd,代码行数:22,代码来源:TddNucleusTestUtils.java
示例6: doPost
import atg.nucleus.Nucleus; //导入依赖的package包/类
/**
* Handle POST callback request. Get Dynamo Request and Response and delegate control to callback handler.
*
*/
@Override
protected void doPost(HttpServletRequest pRequest, HttpServletResponse pResponse)
throws ServletException, IOException {
VirtualPiggyCallbackHandler callbackHandler = (VirtualPiggyCallbackHandler)Nucleus.getGlobalNucleus().resolveName(VIRTUAL_PIGGY_CALLBACK_HANDLER_COMPONENT_PATH);
DynamoHttpServletRequest request = ServletUtil.getDynamoRequest(getServletContext(), pRequest, pResponse);
DynamoHttpServletResponse response = ServletUtil.getDynamoResponse(pRequest, pResponse);
ApplicationLogging logger = request.getLog();
try{
callbackHandler.service(request, response);
}catch(Exception ex){
if(logger != null){
logger.logError("VirtualPiggyCallbackServlet::::" + ex.getMessage());
}
throw new ServletException(ex);
}
}
开发者ID:VirtualPiggyInc,项目名称:oink_oracle_atg_commerce,代码行数:22,代码来源:VirtualPiggyCallbackServlet.java
示例7: createNucleus
import atg.nucleus.Nucleus; //导入依赖的package包/类
public Nucleus createNucleus(@NotNull final File configPath)
throws IOException {
logger.entry(configPath);
final Nucleus existing = getAlreadyRunningNucleus(configPath);
if (existing != null) {
return existing;
}
setUpConfiguration(configPath);
readDynamoLicense();
setSystemPropertiesFromEnvironment();
final String fullConfigPath = buildAtgConfigPath(configPath);
setSystemAtgConfigPath(fullConfigPath);
final Nucleus nucleus = initializeNucleusWithConfigPath(fullConfigPath);
nuclei.put(configPath, nucleus);
return logger.exit(nucleus);
}
开发者ID:jvz,项目名称:dynunit,代码行数:17,代码来源:NucleusFactory.java
示例8: addComponent
import atg.nucleus.Nucleus; //导入依赖的package包/类
/**
* Adds the given object, component to Nucleus, nucleus at the path given
* by componentPath.
*
* @param nucleus
* The Nucleus instance to which the component should be added
* @param componentPath
* the component path at which the component should be added
* @param component
* the component instance to add
*/
public static void addComponent(Nucleus nucleus, String componentPath, Object component) {
// make sure it's not already there
if (nucleus.resolveName(componentPath) != null) {
return;
}
ComponentName name = ComponentName.getComponentName(componentPath);
ComponentName[] subNames = name.getSubNames();
GenericContext[] contexts = new GenericContext[subNames.length - 1];
contexts[0] = nucleus;
for (int i = 1; i < subNames.length - 1; i++) {
contexts[i] = new GenericContext();
// Make sure it's not there
GenericContext tmpContext = (GenericContext) contexts[i
- 1].getElement(subNames[i].getName());
if (tmpContext == null) {
contexts[i - 1].putElement(subNames[i].getName(), contexts[i]);
}
else {
contexts[i] = tmpContext;
}
}
contexts[contexts.length - 1].putElement(
subNames[subNames.length - 1].getName(), component
);
}
开发者ID:jvz,项目名称:dynunit,代码行数:37,代码来源:NucleusUtils.java
示例9: setPropertyValue
import atg.nucleus.Nucleus; //导入依赖的package包/类
/**
* Sets the property of this type for the item descriptor provided.
*
* @param pItem
* the RepositoryItem to set the value for
* @param pValue
* the value to set to the item.
*/
public void setPropertyValue(final RepositoryItemImpl pItem, final Object pValue) {
if (pValue == null) {
return;
}
CryptoEngine cryptoEngine = (CryptoEngine) Nucleus.getGlobalNucleus().resolveName(this.mCryptoEngineName);
if (cryptoEngine == null) {
logError("Property Item Descriptor: " + getItemDescriptor().getItemDescriptorName() + "." + getName()
+ " not property configured.");
throw new NullPointerException("Crypto Engine not configured " + getItemDescriptor().getItemDescriptorName()
+ "." + getPropertyItemDescriptor().getItemDescriptorName());
}
super.setPropertyValue(pItem, cryptoEngine.encrypt(pValue.toString()));
}
开发者ID:sparkred-insight,项目名称:ATGCrypto,代码行数:22,代码来源:CryptoPropertyDescriptor.java
示例10: getGlobalBaseComponent
import atg.nucleus.Nucleus; //导入依赖的package包/类
/**
*
* @param componentName
* The component to find
* @return The component (if found); null otherwise
* @author jon pallas
*
*/
private static Object getGlobalBaseComponent(String componentName) {
Nucleus nucleus = Nucleus.getGlobalNucleus();
if (nucleus != null) {
Object o = nucleus.resolveName(componentName);
return o;
}
return null;
}
开发者ID:varelma,项目名称:atg-generics,代码行数:17,代码来源:ComponentResolver.java
示例11: initialiseRequestResponsePair
import atg.nucleus.Nucleus; //导入依赖的package包/类
public static void initialiseRequestResponsePair(){
ServletTestUtils servletTestUtils = new ServletTestUtils();
TestingDynamoHttpServletRequest request = servletTestUtils.createDynamoHttpServletRequestForSession(Nucleus.getGlobalNucleus(), "1234", null);
request.setLoggingWarning(false);
request.prepareForRead();
ServletUtil.setCurrentRequest(request);
ServletUtil.setCurrentResponse(servletTestUtils.createDynamoHttpServletResponse());
}
开发者ID:Roanis,项目名称:atg-tdd,代码行数:9,代码来源:TddNucleusTestUtils.java
示例12: resolveComponent
import atg.nucleus.Nucleus; //导入依赖的package包/类
public static Object resolveComponent(String componentPath){
ComponentName componentName = ComponentName.getComponentName(componentPath);
Object component = null;
try {
DynamoHttpServletRequest currentRequest = ServletUtil.getCurrentRequest();
if(null != currentRequest){
component = currentRequest.resolveName(componentName);
}
} catch (IllegalStateException e){
component = Nucleus.getGlobalNucleus().resolveName(componentName);
}
return component;
}
开发者ID:Roanis,项目名称:atg-tdd,代码行数:15,代码来源:TddNucleusTestUtils.java
示例13: startTransaction
import atg.nucleus.Nucleus; //导入依赖的package包/类
private void startTransaction() throws TransactionDemarcationException {
mTransactionManager = (TransactionManager) Nucleus.getGlobalNucleus().resolveName("/atg/dynamo/transaction/TransactionManager");
try {
mTransactionManager.begin();
} catch (Exception e) {
e.printStackTrace();
}
}
开发者ID:Roanis,项目名称:atg-tdd,代码行数:9,代码来源:NucleusWithTransaction.java
示例14: getAlreadyRunningNucleus
import atg.nucleus.Nucleus; //导入依赖的package包/类
private Nucleus getAlreadyRunningNucleus(final File configPath) {
logger.entry(configPath);
if (nuclei.containsKey(configPath)) {
final Nucleus nucleus = nuclei.get(configPath);
if (nucleus != null && nucleus.isRunning()) {
return logger.exit(nucleus);
}
}
return logger.exit(null);
}
开发者ID:jvz,项目名称:dynunit,代码行数:11,代码来源:NucleusFactory.java
示例15: startNucleusWithModules
import atg.nucleus.Nucleus; //导入依赖的package包/类
public static Nucleus startNucleusWithModules(String[] modules,
Class classRelativeTo,
String initialService)
throws ServletException, FileNotFoundException {
return startNucleusWithModules(
new NucleusStartupOptions(
modules,
classRelativeTo,
classRelativeTo.getSimpleName() + "/config", // FIXME: factor into private method
initialService
)
);
}
开发者ID:jvz,项目名称:dynunit,代码行数:14,代码来源:NucleusUtils.java
示例16: cleanUpNucleusTemporaryFiles
import atg.nucleus.Nucleus; //导入依赖的package包/类
private static void cleanUpNucleusTemporaryFiles(final Nucleus nucleus)
throws IOException {
final File temporaryFilesDirectory = nucleiConfigPathsCache.get(nucleus);
if (temporaryFilesDirectory == null) {
return;
}
try {
FileUtils.deleteDirectory(temporaryFilesDirectory);
} finally {
nucleiConfigPathsCache.remove(nucleus);
}
}
开发者ID:jvz,项目名称:dynunit,代码行数:13,代码来源:NucleusUtils.java
示例17: getDynamoConfiguration
import atg.nucleus.Nucleus; //导入依赖的package包/类
/**
* returns the Configuration component being used by Dynamo
*/
public static atg.service.dynamo.Configuration getDynamoConfiguration() {
if ( DYN_CONFIG == null ) {
try {
DYN_CONFIG = (atg.service.dynamo.Configuration) Nucleus.getGlobalNucleus()
.resolveName(
CONFIGURATION_COMPONENT
);
} catch ( Throwable t ) {
logger.catching(t);
}
}
return DYN_CONFIG;
}
开发者ID:jvz,项目名称:dynunit,代码行数:17,代码来源:TestUtils.java
示例18: setExternalComponentsOnRequest
import atg.nucleus.Nucleus; //导入依赖的package包/类
/**
* Set any external components needed by pRequest to
* do name resolutions in the various scopes.
*
* @param pNucleus
* the nucleus to use for name resolutions.
* @param pRequest
* the request whose properties should be set.
*/
public void setExternalComponentsOnRequest(Nucleus pNucleus,
DynamoHttpServletRequest pRequest) {
pRequest.setNucleus(pNucleus);
String strMimeTyperPath = getMimeTyperPath();
if (getMimeTyperPath() != null) {
pRequest.setMimeTyper(
(MimeTyper) pNucleus.resolveName(getMimeTyperPath())
);
}
if (getRequestScopeManagerPath() != null) {
pRequest.setRequestScopeManager(
(RequestScopeManager) pNucleus.resolveName(
getRequestScopeManagerPath()
)
);
}
if (getWindowScopeManagerPath() != null) {
pRequest.setWindowScopeManager(
(WindowScopeManager) pNucleus.resolveName(
getWindowScopeManagerPath()
)
);
}
}
开发者ID:jvz,项目名称:dynunit,代码行数:37,代码来源:ServletTestUtils.java
示例19: dropTables
import atg.nucleus.Nucleus; //导入依赖的package包/类
/**
* This method drops all tables required by the GSARepository.
*
* @throws RepositoryException
* if an error occurs while retrieving a list of the tables
* associated with the repository
* @throws SQLProcessorException
* if an error occurred trying to drop the tables
*/
public void dropTables()
throws RepositoryException, SQLProcessorException {
// execute SQL files, if specified
String[] dropFiles = getSpecifiedDropFiles();
if (dropFiles != null) {
if (isExecuteCreateAndDropScripts()) {
executeSqlFiles(dropFiles, false);
}
else if (isLoggingInfo()) {
logInfo("Skipping execution of SQL scripts b/c property 'executeCreateAndDropScripts' is false or there are no drop scripts.");
}
return;
}
// otherwise, just drop tables based on startSQLRepository SQL
if (isUseDDLUtils()) {
try {
if (!Nucleus.getGlobalNucleus().isStopping()) {
// build a new one
schemaGenerator = new GSARepositorySchemaGenerator(this);
}
if (schemaGenerator != null) {
schemaGenerator.dropSchema(true);
}
} catch (DatabaseOperationException e) {
throw new RepositoryException(e);
}
}
else {
List<String> statements = getCreateStatements(null, null);
SQLProcessorEngine processor = getSQLProcessor();
processor.dropTablesFromCreateStatements(statements);
}
}
开发者ID:jvz,项目名称:dynunit,代码行数:46,代码来源:InitializingGSA.java
示例20: startRepository
import atg.nucleus.Nucleus; //导入依赖的package包/类
/**
* @param pRepository
* @param c
* @param n
* @param newRepository
*
* @throws ServiceException
*/
private static void startRepository(GSARepository pRepository,
Configuration c,
Nucleus n,
GSARepository newRepository)
throws ServiceException {
ServiceEvent ev = new ServiceEvent(pRepository, newRepository, n, c);
/*
* We are purposefully not putting the new repository into the parent's name
* context. The existing repository is always the valid one. We're starting
* this new guy, then we're going to synchronize on the repository and get
* all of its info into us.
*/
// we have to set the new repository as temporary so it won't call
// restart and start an infinite recursion
// newRepository.setTemporaryInstantiation(true);
// But don't load data
if (newRepository instanceof InitializingGSA) {
((InitializingGSA) newRepository).setImportFiles(null);
}
newRepository.startService(ev);
if (newRepository.isRunning()) {
synchronized (pRepository) {
// newRepository.copyFromOtherRepository(pRepository);
newRepository.invalidateCaches();
}
}
}
开发者ID:jvz,项目名称:dynunit,代码行数:40,代码来源:GSATestUtils.java
注:本文中的atg.nucleus.Nucleus类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论