org.camunda.bpm.application.PreUndeploy Java Examples

The following examples show how to use org.camunda.bpm.application.PreUndeploy. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ProcessApplicationStartService.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
protected void invokePreUndeploy(final ProcessApplicationInterface processApplication) throws ClassNotFoundException {
  if(preUndeployDescription != null) {
    Class<?> paClass = getPaClass(preUndeployDescription);
    final Method preUndeployMethod = InjectionUtil.detectAnnotatedMethod(paClass, PreUndeploy.class);

    if(preUndeployMethod != null) {
      try {
        processApplication.execute(new Callable<Void>() {
          @Override
          public Void call() throws Exception {
            preUndeployMethod.invoke(processApplication.getRawObject(), getInjections(preUndeployMethod));
            return null;
          }
        });
      } catch(Exception e) {
        throw new RuntimeException("Exception while invoking the @PreUndeploy method ", e);
      }
    }
  }

}
 
Example #2
Source File: ProcessApplicationStartService.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
protected void invokePreUndeploy(final ProcessApplicationInterface processApplication) throws ClassNotFoundException {
  if(preUndeployDescription != null) {
    Class<?> paClass = getPaClass(preUndeployDescription);
    final Method preUndeployMethod = InjectionUtil.detectAnnotatedMethod(paClass, PreUndeploy.class);

    if(preUndeployMethod != null) {
      try {
        processApplication.execute(new Callable<Void>() {
          @Override
          public Void call() throws Exception {
            preUndeployMethod.invoke(processApplication.getRawObject(), getInjections(preUndeployMethod));
            return null;
          }
        });
      } catch(Exception e) {
        throw new RuntimeException("Exception while invoking the @PreUndeploy method ", e);
      }
    }
  }

}
 
Example #3
Source File: PrintServiceProcessApplication.java    From camunda-bpm-mail with Apache License 2.0 5 votes vote down vote up
@PreUndeploy
public void stopService() throws Exception {

  notificationService.stop();

  MailService mailService = MailServiceFactory.getService(configuration);
  mailService.close();
}
 
Example #4
Source File: SpringBootProcessApplication.java    From camunda-bpm-spring-boot-starter with Apache License 2.0 4 votes vote down vote up
@PreUndeploy
public void onPreUndeploy(ProcessEngine processEngine) {
  eventPublisher.publishEvent(new PreUndeployEvent(processEngine));
}
 
Example #5
Source File: SpringBootProcessApplication.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
@PreUndeploy
public void onPreUndeploy(ProcessEngine processEngine) {
  eventPublisher.publishEvent(new PreUndeployEvent(processEngine));
}
 
Example #6
Source File: CustomSpringServletProcessApplication.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
@PreUndeploy
public void preUndeploy() {
  isPreUndeployInvoked = true;
}
 
Example #7
Source File: CustomEjbProcessApplication.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
@PreUndeploy
public void preUnDeploy(ProcessEngine processEngine) {
  Assert.assertNotNull(processEngine);
}
 
Example #8
Source File: PostDeployRegistrationPa.java    From camunda-bpm-platform with Apache License 2.0 3 votes vote down vote up
@PreUndeploy
public void unregisterProcessApplicaiton(ProcessEngine processEngine) {

  // unregister with the process engine
  processEngine.getManagementService()
    .unregisterProcessApplication(deploymentId, true);

  isPreUndeployInvoked = true;

}