Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log message not complete #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions src/main/java/org/ow2/petals/se/mapping/MappingSuManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ public MappingSuManager(final AbstractServiceEngine component) {

@Override
protected void doDeploy(final ServiceUnitDataHandler suDH) throws PEtALSCDKException {
if (this.logger.isLoggable(Level.FINE)) {
this.logger.fine("Deploying specific part of SU = " + suDH.getName() + ") ...");
if (this.logger.isLoggable(Level.FINE)&& suDH != null) {
Copy link
Member

@cdeneux cdeneux Jun 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here suDH must be not null. Unneeded to check it

this.logger.log(Level.FINE, "Deploying specific part of SU = {0} ...", suDH.getName() );
}

final Jbi jbiDescriptor = suDH.getDescriptor();
Expand All @@ -73,9 +73,11 @@ protected void doDeploy(final ServiceUnitDataHandler suDH) throws PEtALSCDKExcep
"Invalid JBI descriptor: one and only one 'consumes' section must be defined.");
}
final Consumes serviceProvider = jbiDescriptor.getServices().getConsumes().get(0);
if (serviceProvider.getOperation() != null) {
this.logger.warning(
"An operation '%s' is defined into the 3PP service provider definition in the JBI descriptor. It won't be used, remove it !!");
if (serviceProvider.getOperation() != null && this.logger.isLoggable(Level.WARNING)) {
this.logger.log(Level.WARNING,
"An operation '{0}' is defined into the 3PP service provider definition in the JBI descriptor. It won't be used, remove it !!",
serviceProvider.getOperation());
}
}

// Check that there is only one Provides section in the SU
Expand Down Expand Up @@ -107,20 +109,20 @@ protected void doDeploy(final ServiceUnitDataHandler suDH) throws PEtALSCDKExcep
this.getComponent().logEptOperationToMappingOperation();

if (this.logger.isLoggable(Level.FINE)) {
this.logger.fine("Specific part of SU = " + suDH.getName() + ") deployed.");
this.logger.log(Level.FINE, "Specific part of SU = {0}) deployed.", suDH.getName() );
}
}

@Override
protected void doUndeploy(final ServiceUnitDataHandler suDH) throws PEtALSCDKException {
this.logger.fine("Undeploying specific part of SU = " + suDH.getName() + ") ...");
this.logger.log(Level.FINE, "Undeploying specific part of SU = {0}) ...", suDH.getName());
try {
final String edptName = suDH.getDescriptor().getServices().getProvides().iterator().next()
.getEndpointName();
// Remove the mapping operations in the map with the corresponding end-point
this.getComponent().removeMappingOPerations(edptName);
} finally {
this.logger.fine("Specific part of SU = " + suDH.getName() + ") undeployed");
this.logger.log(Level.FINE, "Specific part of SU = {0}) undeployed", suDH.getName());
}
}

Expand Down