public Object put(String key, Object value) { if (writeContextName == null) { return null; } Context writeContext = environment.getContext(writeContextName); if (writeContext == null) { return null; } return writeContext.set(key, value); }
public static Environment openEnvironment(final String xmlString) { final EnvironmentFactory environmentFactory = PvmEnvironmentFactory .parseXmlString(xmlString); return environmentFactory.openEnvironment(); }
protected Context getReadContext(Object key) { for (String readContextName : readContextNames) { Context readContext = environment.getContext(readContextName); if ((readContext != null) && (readContext.has((String) key))) { return readContext; } } return null; }
public static ScriptManager getScriptManager() { Environment environment = Environment.getCurrent(); if (environment != null) { ScriptManager scriptManager = environment.get(ScriptManager.class); if (scriptManager != null) { return scriptManager; } } return defaultScriptManager; }
public CommentImpl(String message) { this.message = message; this.time = Clock.getCurrentTime(); Environment environment = Environment.getCurrent(); if (environment != null) { this.userId = environment.getUserId(); } }
public DbSession getDbSession() { return environment.get(DbSession.class); }
public EnvironmentBindings(String[] readContextNames, String writeContextName) { this.readContextNames = readContextNames; this.writeContextName = writeContextName; environment = Environment.getCurrent(); }
public <T> T execute(Command<T> command) { Environment environment = environmentFactory.openEnvironment(); try { return next.execute(command); } finally { environment.close(); } }
public static Object getFromCurrent(String name) { return getFromCurrent(name, true); }
public void register(Transaction transaction) { // registration of the synchronization is delegated to the // AfterTxCompletionListener // to avoid a dependency on class Synchronization in class // ExceptionHandlerImpl transaction.registerSynchronization(this); } }
void closeEnvironment() { environment.close(); environment = null; }
public Object get(Object key) { Context context = getReadContext(key); if (context != null) { return context.get((String) key); } return null; }
protected BlobStrategy getBlobStrategy() { BlobStrategy blobStrategy = null; Environment environment = Environment.getCurrent(); if (environment != null) { blobStrategy = environment.get(BlobStrategy.class); } if (blobStrategy == null) { blobStrategy = DEFAULT_BLOB_STRATEGY; } return blobStrategy; }
public List<Timer> execute(Environment environment) throws Exception { PvmDbSession pvmDbSession = environment.get(PvmDbSession.class); return pvmDbSession.findTimers(firstResult, maxResults); } }
public Object construct(WireContext wireContext) { return Environment.getCurrent(); } }
public T doInTransaction(TransactionStatus status) { Environment environment = environmentFactory.openEnvironment(); try { return command.execute(environment); } catch (Exception e) { throw new RuntimeException("ooops", e); } finally { environment.close(); } }
public static <T> T getFromCurrent(Class<T> type) { return getFromCurrent(type, true); }
protected ClobStrategy getClobStrategy() { ClobStrategy clobStrategy = null; Environment environment = Environment.getCurrent(); if (environment != null) { clobStrategy = environment.get(ClobStrategy.class); } if (clobStrategy == null) { clobStrategy = DEFAULT_CLOB_STRATEGY; } return clobStrategy; }
protected T resolveValueExpression() { Environment environment = Environment.getCurrent(); return null; }
public Object construct(WireContext wireContext) { return Environment.getCurrent().get(Transaction.class); }