Search in sources :

Example 1 with AssociationListener

use of org.dcm4che3.net.AssociationListener in project dcm4chee-arc-light by dcm4che.

the class CStoreForward method createTask.

private CStoreForwardTask createTask(final Association as) {
    ApplicationEntity localAE = retrieveCtx.getLocalApplicationEntity();
    Association storeas = openAssociation(as, localAE);
    final CStoreForwardTask task = new CStoreForwardTask(retrieveCtx, storeas);
    forwardTasks.put(as, task);
    as.addAssociationListener(new AssociationListener() {

        @Override
        public void onClose(Association association) {
            task.onStore(null);
            forwardTasks.remove(as);
        }
    });
    if (storeas != null) {
        retrieveCtx.incrementPendingCStoreForward();
        localAE.getDevice().execute(task);
    }
    return task;
}
Also used : Association(org.dcm4che3.net.Association) ApplicationEntity(org.dcm4che3.net.ApplicationEntity) AssociationListener(org.dcm4che3.net.AssociationListener)

Aggregations

ApplicationEntity (org.dcm4che3.net.ApplicationEntity)1 Association (org.dcm4che3.net.Association)1 AssociationListener (org.dcm4che3.net.AssociationListener)1