@Override protected void internalStop() throws ServiceExecutionException { if (ccpEventManager != null) { try { ccpEventManager.stop(); } catch (Exception e) { throw new ServiceExecutionException(e, ServiceErrorID.SERVICE_LAUNCH_ERROR); } } super.internalStop(); }
@Override protected void internalCreate() throws ServiceExecutionException { super.internalCreate(); try { session = transportProvider.getConnection().createSession(false, Session.CLIENT_ACKNOWLEDGE); ccpEventManager = new CCPEventManager(service, session, logger); logger.log( Level.FINE, RBUtil.getMessage(Bundle.class, Bundle.COMMUNICATION_WITH_PEER_ESTABLISHED)); } catch (JMSException e) { throw new ServiceExecutionException( RBUtil.getMessage(Bundle.class, Bundle.FAILED_TO_START_COMMUNICATION_WITH_PEER), e, ServiceErrorID.SERVICE_LAUNCH_ERROR); } }
@Override protected void internalDestroy() throws ServiceExecutionException { try { if (session != null) { try { session.close(); } finally { session = null; } } if (ccpEventManager != null) { ccpEventManager = null; } logger.log( Level.FINE, RBUtil.getMessage(Bundle.class, Bundle.COMMUNICATION_WITH_PEER_ESTABLISHED)); } catch (JMSException e) { logger.log( Level.WARNING, RBUtil.getMessage(Bundle.class, Bundle.FAILED_TO_CLOSE_COMMUNICATION_WITH_PEER), e); } super.internalDestroy(); }