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; }
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; }
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; }