public void event(Event event) {
if(logger.isLoggable(Level.FINEST)) {
logger.finest("JpaDeployer.event():" + event.name());
}
if (event.is(Deployment.APPLICATION_PREPARED) ) {
ExtendedDeploymentContext context = (ExtendedDeploymentContext)event.hook();
DeployCommandParameters deployCommandParameters = context.getCommandParameters(DeployCommandParameters.class);
if(logger.isLoggable(Level.FINE)) {
logger.fine("JpaDeployer.event(): Handling APPLICATION_PREPARED origin is:" + deployCommandParameters.origin);
}
// When create-application-ref is called for an already deployed app, APPLICATION_PREPARED will be sent on DAS
// Obviously there is no new emf created for this event and we need not do java2db also. Ignore the event
// However, if target for create-application-ref is DAS => the app was deployed on other instance but now
// an application-ref is being created on DAS. Process the app
if(!deployCommandParameters.origin.isCreateAppRef() || isTargetDas(deployCommandParameters)) {
Map<String, ExtendedDeploymentContext> deploymentContexts = context.getModuleDeploymentContexts();
for (DeploymentContext deploymentContext : deploymentContexts.values()) {
//bundle level pus
iterateInitializedPUsAtApplicationPrepare(deploymentContext);
}