public ActivityContextImpl createActivityContext(final ActivityContextHandle ach, int activityFlags) throws ActivityAlreadyExistsException { if (sleeContainer.getCongestionControl().refuseStartActivity()) { throw new SLEEException("congestion control refused activity start"); } // create ac ActivityContextCacheDataWrapper activityContextCacheData =getCacheData(ach); if (activityContextCacheData.exists()) { throw new ActivityAlreadyExistsException(ach.toString()); } ActivityContextImpl ac = new ActivityContextImpl(ach,activityContextCacheData,tracksIdleTime(ach,true),Integer.valueOf(activityFlags),this); if (logger.isDebugEnabled()) { logger.debug("Created activity context with handle "+ach); } return ac; }
XmppConnection createActivity(String connectionID, XMPPConnection connection, XmppActivityHandle handle) throws XMPPException { XmppConnection activity = new XmppConnection(connectionID,connection); if (activities.putIfAbsent(handle,activity) == null) { try { sleeEndpoint.startActivity(handle,activity,ActivityFlags.REQUEST_ENDED_CALLBACK); } catch (ActivityAlreadyExistsException e) { log.warning(e.getMessage(),e); } catch (Throwable e) { activities.remove(handle); throw new XMPPException(e.getMessage(),e); } } return activity; }
public void handleActivityCreatedBySbb(TCKActivityID activityID) throws TCKTestErrorException, RemoteException { try { sleeEndpoint.activityStarted(new TCKActivityHandle(activityID)); } catch (ActivityAlreadyExistsException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (CouldNotStartActivityException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
public CircuitActivity createCircuitActivity(ISUPMessage arg0,int dpc) throws IllegalArgumentException, ActivityAlreadyExistsException, NullPointerException, IllegalStateException, SLEEException, StartActivityException { ActivityHandle handle=new ISUPActivityHandle(CircuitActivity.generateTransactionKey(arg0.getCircuitIdentificationCode().getCIC(),dpc)); if(activities.containsKey(handle)) throw new ActivityAlreadyExistsException("Circuit activity already exists"); CircuitActivity activity = new CircuitActivity(arg0,dpc,this); handle = createActivityHandle(activity); sleeEndpoint.startActivity(handle, activity,ACTIVITY_FLAGS); activities.putIfAbsent(handle,activity); return activity; }
} catch (ActivityAlreadyExistsException e) { e.printStackTrace(); } catch (IllegalArgumentException e) {
public NullActivityImpl createNullActivity( NullActivityHandle nullActivityHandle, boolean mandateTransaction) throws TransactionRequiredLocalException, FactoryException { // check mandated by SLEE TCK test CreateActivityWhileStoppingTest if (sleeContainer.getSleeState() != SleeState.RUNNING) { return null; } if (mandateTransaction) { sleeContainer.getTransactionManager().mandateTransaction(); } // create activity NullActivityImpl nullActivity = new NullActivityImpl(nullActivityHandle); // get an activity context for it try { sleeContainer.getActivityContextFactory().createActivityContext( new NullActivityContextHandle(nullActivityHandle), ActivityFlags.REQUEST_ACTIVITY_UNREFERENCED_CALLBACK); } catch (ActivityAlreadyExistsException e) { throw new FactoryException(e.getMessage(), e); } if (logger.isDebugEnabled()) { logger .debug("NullActivityFactory.createNullActivity() Created null activity " + nullActivity); } return nullActivity; }
throw new ActivityAlreadyExistsException(handle.toString()); if (handle2RefTxData != null) { throw new ActivityAlreadyExistsException(handle.toString());
private TFTPTransfer createTransferActivity(TFTPPacket tftpPacket) throws ActivityAlreadyExistsException, NullPointerException, IllegalStateException, SLEEException, StartActivityException { TransferActivityImpl activity = new TransferActivityImpl(); TransferActivityHandle handle = new TransferActivityHandle(activity.getTransferID()); TFTPTransfer tt = new TFTPTransfer(tftpPacket, activity, mode_, maxTimeoutRetries_, socketTimeout_, this, trc); activity.setSource(tt); // lookup the activity and check if already exists if (activities.get(handle) == null) { activities.put(handle, activity); sleeEndpoint.startActivity(handle, activity); if (trc.isFineEnabled()) trc.fine("Started Tftp transfer activity: " + activity.getTransferID()); } else { throw new ActivityAlreadyExistsException( "Duplicate transfer activity id: " + activity); } return tt; }
private TFTPTransfer createTransferActivity(TFTPPacket tftpPacket) throws ActivityAlreadyExistsException, NullPointerException, IllegalStateException, SLEEException, StartActivityException { TransferActivityImpl activity = new TransferActivityImpl(); TransferActivityHandle handle = new TransferActivityHandle(activity.getTransferID()); TFTPTransfer tt = new TFTPTransfer(tftpPacket, activity, mode_, maxTimeoutRetries_, socketTimeout_, this, trc); activity.setSource(tt); // lookup the activity and check if already exists if (activities.get(handle) == null) { activities.put(handle, activity); sleeEndpoint.startActivity(handle, activity); if (trc.isFineEnabled()) trc.fine("Started Tftp transfer activity: " + activity.getTransferID()); } else { throw new ActivityAlreadyExistsException( "Duplicate transfer activity id: " + activity); } return tt; }