@NotNull public String getNodeName() { final String nodeIdentifier = arjPropertyManager.getCoreEnvironmentBean().getNodeIdentifier(); if (nodeIdentifier == null) { throw Log.log.noLocalTransactionProviderNodeName(); } return nodeIdentifier; }
@Override protected boolean applyUpdateToRuntime(final OperationContext context, final ModelNode operation, final String attributeName, final ModelNode resolvedValue, final ModelNode currentValue, final HandbackHolder<Void> handbackHolder) throws OperationFailedException { if (this.coordinatorEnvironmentBean == null) { this.coordinatorEnvironmentBean = arjPropertyManager.getCoordinatorEnvironmentBean(); } coordinatorEnvironmentBean.setEnableStatistics(resolvedValue.asBoolean()); return false; }
&& (recordBeingHandled.propagateOnAbort())) merge(recordBeingHandled); updateHeuristic(TwoPhaseOutcome.FINISH_OK, false); // remember || (ok == TwoPhaseOutcome.HEURISTIC_MIXED) || (ok == TwoPhaseOutcome.HEURISTIC_HAZARD))) { if (actionType == ActionType.TOP_LEVEL) tsLogger.i18NLogger.warn_coordinator_BasicAction_52(get_uid(), TwoPhaseOutcome.stringForm(ok)); else tsLogger.i18NLogger.warn_coordinator_BasicAction_53(get_uid(), TwoPhaseOutcome.stringForm(ok)); updateHeuristic(ok, false); tsLogger.i18NLogger.warn_coordinator_BasicAction_54(get_uid(), TwoPhaseOutcome.stringForm(ok), RecordType.typeToClass(recordBeingHandled.typeIs()).getCanonicalName()); else "BasicAction::doAbort() result for action-id (%s) on record id: (%s) is (%s) node id: (%s)", get_uid(), record.order(), TwoPhaseOutcome.stringForm(ok), arjPropertyManager.getCoreEnvironmentBean().getNodeIdentifier());
/** * Create a transaction of the specified type. */ protected BasicAction (int at) { super(ObjectType.NEITHER); pendingList = null; preparedList = null; readonlyList = null; failedList = null; heuristicList = null; currentHierarchy = null; transactionStore = null; savedIntentionList = false; actionStatus = ActionStatus.CREATED; actionType = at; parentAction = null; recordBeingHandled = null; heuristicDecision = TwoPhaseOutcome.PREPARE_OK; _checkedAction = arjPropertyManager .getCoordinatorEnvironmentBean().getCheckedActionFactory() .getCheckedAction(get_uid(), type()); _childThreads = null; _childActions = null; }
updateHeuristic(TwoPhaseOutcome.FINISH_OK, true); // must tsLogger.logger.trace("BasicAction.doCommit for "+get_uid()+" received "+ TwoPhaseOutcome.stringForm(ok)+" from "+RecordType.typeToClass(recordBeingHandled.typeIs())); || (ok == TwoPhaseOutcome.HEURISTIC_MIXED) || (ok == TwoPhaseOutcome.HEURISTIC_HAZARD))) updateHeuristic(ok, true); heuristicList.insert(recordBeingHandled); addDeferredThrowables(recordBeingHandled, deferredThrowables); tsLogger.logger.tracef( "BasicAction::doCommit() result for action-id (%s) on record id: (%s) is (%s) node id: (%s)", get_uid(), record.order(), TwoPhaseOutcome.stringForm(ok), arjPropertyManager.getCoreEnvironmentBean().getNodeIdentifier());
/** * @return the process id. This had better be unique between processes on * the same machine. If not we're in trouble! */ public int getpid () { synchronized (ManualProcessId._lock) { if (_pid == -1) { _pid = arjPropertyManager.getCoreEnvironmentBean().getPid(); } } if (_pid == -1) throw new FatalError(tsLogger.i18NLogger.get_utils_ManualProcessId_1()); return _pid; }
public SocketProcessId() { int port = arjPropertyManager.getCoreEnvironmentBean().getSocketProcessIdPort(); int maxPorts = arjPropertyManager.getCoreEnvironmentBean().getSocketProcessIdMaxPorts(); int maxPort; if (maxPorts <= 1) { maxPort = port; } else if (Utility.MAX_PORT - maxPorts < port) { maxPort = Utility.MAX_PORT; } else { maxPort = port + maxPorts; } do { _theSocket = createSocket(port); } while (_theSocket == null && ++port < maxPort); _thePort = ((_theSocket == null) ? -1 : _theSocket.getLocalPort()); if (_thePort == -1) { throw new FatalError(tsLogger.i18NLogger.get_utils_SocketProcessId_2()); } }
private static synchronized void initDefaultProcess () { if(processHandle == null) { processHandle = arjPropertyManager.getCoreEnvironmentBean().getProcessImplementation(); if(processHandle == null) { tsLogger.i18NLogger.warn_utils_Utility_1(); } } }
@SuppressWarnings("unchecked") protected synchronized void setupStore (String rootName) { setupStore(rootName, arjPropertyManager.getObjectStoreEnvironmentBean() .getObjectStoreType()); }
public static boolean enabled() { //not thread safe but not sure we require thread safety as long as eventually all threads stop setting the bean if(_environmentBean==null){ _environmentBean=arjPropertyManager.getCoordinatorEnvironmentBean(); } return _environmentBean.isEnableStatistics(); }
@Override public void init() { arjPropertyManager.getCoordinatorEnvironmentBean().setCommitOnePhase(false); arjPropertyManager.getObjectStoreEnvironmentBean().setObjectStoreType(TwoPhaseVolatileStore.class.getName()); tm = com.arjuna.ats.jta.TransactionManager.transactionManager(); }
private void init(String logDir) { if (logDir != null) arjPropertyManager.getObjectStoreEnvironmentBean().setObjectStoreDir(logDir); if (tsLogger.logger.isTraceEnabled()) tsLogger.logger.trace("ObjectStoreDir: " + arjPropertyManager.getObjectStoreEnvironmentBean().getObjectStoreDir()); allUids = new HashMap<String, List<UidWrapper>> (); stateTypes = new HashMap<String, String>(); beanTypes = new HashMap<String, String>(); initTypeHandlers(defaultStateHandlers); initTypeHandlers(System.getProperty(OBJ_STORE_BROWSER_HANDLERS, "")); }
@Override public void start(StartContext context) throws StartException { // Global configuration. final CoreEnvironmentBean coreEnvironmentBean = arjPropertyManager.getCoreEnvironmentBean(); if(coreEnvironmentBean.getProcessImplementationClassName() == null) { UuidProcessId id = new UuidProcessId(); coreEnvironmentBean.setProcessImplementation(id); } try { coreEnvironmentBean.setNodeIdentifier(nodeIdentifier); } catch (CoreEnvironmentBeanException e) { throw new StartException(e.getCause()); } // Setup the socket process id if there is a binding SocketBinding binding = socketProcessBindingInjector.getOptionalValue(); if(binding != null) { int port = binding.getPort(); coreEnvironmentBean.setSocketProcessIdPort(port); } }
@Override public void load() { log.info("Initiating Narayana JTA"); arjPropertyManager.getObjectStoreEnvironmentBean().setObjectStoreDir("ObjectStore"); try { JNDIManager.bindJTAImplementation(); } catch (NamingException e) { log.log(Level.WARNING, e.getMessage(), e); } } }
@Override public CoreEnvironmentBean getValue() throws IllegalStateException, IllegalArgumentException { CoreEnvironmentBean coreEnvironmentBean = arjPropertyManager.getCoreEnvironmentBean(); return coreEnvironmentBean; }
@Override public void init() { arjPropertyManager.getObjectStoreEnvironmentBean().setObjectStoreType(TwoPhaseVolatileStore.class.getName()); tm = com.arjuna.ats.jta.TransactionManager.transactionManager(); }
@Override public synchronized void start(final StartContext context) throws StartException { final CoordinatorEnvironmentBean coordinatorEnvironmentBean = arjPropertyManager.getCoordinatorEnvironmentBean(); coordinatorEnvironmentBean.setEnableStatistics(coordinatorEnableStatistics); coordinatorEnvironmentBean.setDefaultTimeout(coordinatorDefaultTimeout); coordinatorEnvironmentBean.setTransactionStatusManagerEnable(transactionStatusManagerEnable);
public static ObjStoreTypeBean getObjectStoreBrowserBean() throws OperationsException, MBeanException, InterruptedException, IOException { if (localStore == null) localStore = (ObjStoreBean) getObjectStoreBrowserBean(0, arjPropertyManager.getObjectStoreEnvironmentBean().getObjectStoreDir()); return localStore; }
@BeforeClass public static void setup() throws SystemException { arjPropertyManager.getCoordinatorEnvironmentBean().setTxReaperTimeout(reaperCheckPeriod); arjPropertyManager.getCoordinatorEnvironmentBean().setEnableStatistics(true); tm = com.arjuna.ats.jta.TransactionManager.transactionManager(); tm.setTransactionTimeout(1); }
public boolean forgetHeuristic() { try { if (!isForgotten()) forget(); } catch (org.omg.CORBA.SystemException ignore) { } if (isForgotten() || (rec != null && rec.forgetHeuristic())) return true; return arjPropertyManager.getObjectStoreEnvironmentBean().isIgnoreMBeanHeuristics(); } }