@Override protected void runWork() throws WorkCompletedException { // if there is security and elytron is enabled, we need to let the context run the remainder of the work // so the context can run the work as the specified Elytron identity if (securityIntegration.getSecurityContext() != null && ((CallbackImpl) workManager.getCallbackSecurity()).isElytronEnabled()) ((ElytronSecurityContext) securityIntegration.getSecurityContext()).runWork(() -> { try { WildflyWorkWrapper.super.runWork(); } catch (WorkCompletedException e) { ConnectorLogger.ROOT_LOGGER.unexceptedWorkerCompletionError(e.getLocalizedMessage(),e); } }); // delegate to super class if there is no elytron enabled else super.runWork(); } }
/** * Clone the WorkManager implementation * @return A copy of the implementation * @exception CloneNotSupportedException Thrown if the copy operation isn't supported * */ @Override public WorkManager clone() throws CloneNotSupportedException { WorkManagerImpl wm = (WorkManagerImpl) super.clone(); wm.setId(getId()); wm.setName(getName()); wm.setShortRunningThreadPool(getShortRunningThreadPool()); wm.setLongRunningThreadPool(getLongRunningThreadPool()); wm.setXATerminator(getXATerminator()); wm.setSpecCompliant(isSpecCompliant()); wm.setCallbackSecurity(getCallbackSecurity()); wm.setSecurityIntegration(getSecurityIntegration()); wm.setStatistics(statistics); return wm; }
doFirstChecks(work, startTimeout, execContext); deltaStartWorkAccepted(); wrapper = createWorkWrapper(securityIntegration, work, execContext, workListener, startedLatch, null); setup(wrapper, workListener); BlockingExecutor executor = getExecutor(work); deltaStartWorkRejected(); checkWorkCompletionException(wrapper);
try doFirstChecks(work, startTimeout, execContext); deltaDoWorkAccepted(); wrapper = createWorkWrapper(securityIntegration, work, execContext, workListener, null, completedLatch); setup(wrapper, workListener); BlockingExecutor executor = getExecutor(work); deltaDoWorkRejected(); checkWorkCompletionException(wrapper);
try doFirstChecks(work, startTimeout, execContext); deltaScheduleWorkAccepted(); wrapper = createWorkWrapper(securityIntegration, work, execContext, workListener, null, null); setup(wrapper, workListener); BlockingExecutor executor = getExecutor(work); deltaScheduleWorkRejected(); checkWorkCompletionException(wrapper);
workManager.getXATerminator().registerWork(work, xid, timeout); if (securityContext != null && workManager.getCallbackSecurity() != null) if (workManager.getCallbackSecurity() != null) cbh = securityIntegration.createCallbackHandler(workManager.getCallbackSecurity()); log.tracef("Callback security: %s", workManager.getCallbackSecurity()); workManager.getCallbackSecurity().getDomain() != null) String scDomain = workManager.getCallbackSecurity().getDomain(); if (workManager.getCallbackSecurity() != null) if (workManager.getCallbackSecurity().getDefaultPrincipal() != null) Principal defaultPrincipal = workManager.getCallbackSecurity().getDefaultPrincipal(); if (workManager.getCallbackSecurity().getDefaultGroups() != null) String[] defaultGroups = workManager.getCallbackSecurity().getDefaultGroups(); else if (securityContext != null && workManager.getCallbackSecurity() == null) workManager.getXATerminator().startWork(work, xid);
/** * Do first checks for work starting methods * @param work to check * @param startTimeout to check * @param execContext to check * @throws WorkException in case of check don't pass */ public void doFirstChecks(Work work, long startTimeout, ExecutionContext execContext) throws WorkException { if (isShutdown()) throw new WorkRejectedException(bundle.workmanagerShutdown()); if (work == null) throw new WorkRejectedException(bundle.workIsNull()); if (startTimeout < 0) throw new WorkRejectedException(bundle.startTimeoutIsNegative(startTimeout)); checkAndVerifyWork(work, execContext); }
workManager.addWorkWrapper(this); workManager.removeWorkWrapper(this); work.release();
/** * {@inheritDoc} */ @Override protected void deltaScheduleWorkAccepted() { log.trace("deltaScheduleWorkAccepted"); super.deltaScheduleWorkAccepted(); if (distributedStatisticsEnabled && distributedStatistics != null && transport != null) { try { checkTransport(); distributedStatistics.sendDeltaScheduleWorkAccepted(); } catch (WorkException we) { log.debugf("deltaScheduleWorkAccepted: %s", we.getMessage(), we); } } }
/** * {@inheritDoc} */ @Override protected void deltaDoWorkAccepted() { log.trace("deltaDoWorkAccepted"); super.deltaDoWorkAccepted(); if (distributedStatisticsEnabled && distributedStatistics != null && transport != null) { try { checkTransport(); distributedStatistics.sendDeltaDoWorkAccepted(); } catch (WorkException we) { log.debugf("deltaDoWorkAccepted: %s", we.getMessage(), we); } } }
/** * {@inheritDoc} */ @Override protected void deltaDoWorkRejected() { log.trace("deltaDoWorkRejected"); super.deltaDoWorkRejected(); if (distributedStatisticsEnabled && distributedStatistics != null && transport != null) { try { checkTransport(); distributedStatistics.sendDeltaDoWorkRejected(); } catch (WorkException we) { log.debugf("deltaDoWorkRejected: %s", we.getMessage(), we); } } }
/** * Clone the WorkManager implementation * @return A copy of the implementation * @exception CloneNotSupportedException Thrown if the copy operation isn't supported * */ @Override public org.jboss.jca.core.api.workmanager.WorkManager clone() throws CloneNotSupportedException { DistributedWorkManagerImpl wm = (DistributedWorkManagerImpl)super.clone(); wm.listeners = Collections.synchronizedList(new ArrayList<NotificationListener>(3)); wm.setPolicy(getPolicy()); wm.setSelector(getSelector()); wm.setTransport(getTransport()); wm.setDistributedStatisticsEnabled(isDistributedStatisticsEnabled()); wm.setDoWorkDistributionEnabled(isDoWorkDistributionEnabled()); wm.setStartWorkDistributionEnabled(isStartWorkDistributionEnabled()); wm.setScheduleWorkDistributionEnabled(isScheduleWorkDistributionEnabled()); return wm; }
@Override protected void runWork() throws WorkCompletedException { // if there is security and elytron is enabled, we need to let the context run the remainder of the work // so the context can run the work as the specified Elytron identity if (securityIntegration.getSecurityContext() != null && ((CallbackImpl) workManager.getCallbackSecurity()).isElytronEnabled()) ((ElytronSecurityContext) securityIntegration.getSecurityContext()).runWork(() -> { try { WildflyWorkWrapper.super.runWork(); } catch (WorkCompletedException e) { ConnectorLogger.ROOT_LOGGER.unexceptedWorkerCompletionError(e.getLocalizedMessage(),e); } }); // delegate to super class if there is no elytron enabled else super.runWork(); } }