use of alma.acsErrTypeLifeCycle.wrappers.AcsJEventSubscriptionEx in project ACS by ACS-Community.
the class AcsEventSubscriberImplBase method removeSubscription.
@Override
public final <U extends T> void removeSubscription(Class<U> structClass) throws AcsJEventSubscriptionEx {
// Removing subscription from receivers list
if (structClass != null) {
if (receivers.containsKey(structClass)) {
receivers.remove(structClass);
notifySubscriptionRemoved(structClass);
} else {
AcsJEventSubscriptionEx ex = new AcsJEventSubscriptionEx();
ex.setContext("Trying to unsubscribe from an event type not being subscribed to.");
ex.setEventType(structClass.getName());
throw ex;
}
} else {
// Removing every type of event
receivers.clear();
notifyNoSubscription();
}
}
use of alma.acsErrTypeLifeCycle.wrappers.AcsJEventSubscriptionEx in project ACS by ACS-Community.
the class AcsEventSubscriberImplBase method removeGenericSubscription.
/**
* Removes the generic receiver handler.
*
* @throws AcsJCORBAProblemEx
*/
@Override
public final void removeGenericSubscription() throws AcsJEventSubscriptionEx {
if (genericReceiver == null) {
AcsJEventSubscriptionEx ex = new AcsJEventSubscriptionEx();
ex.setContext("Failed to remove generic subscription when not actually subscribed.");
ex.setEventType("generic");
throw ex;
}
notifySubscriptionRemoved(null);
genericReceiver = null;
}
Aggregations