Skip to content

Commit

Permalink
[WFLY-11354] Refactoring EndpointDeployeService to use non deprecated…
Browse files Browse the repository at this point in the history
… ServiceBuilder methods.
  • Loading branch information
ropalka committed Nov 15, 2018
1 parent 04f00f3 commit 8bcbb79
Showing 1 changed file with 4 additions and 10 deletions.
Expand Up @@ -30,9 +30,8 @@
import org.jboss.as.webservices.util.WSAttachmentKeys;
import org.jboss.as.webservices.util.WSServices;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.msc.service.Service;
import org.jboss.msc.Service;
import org.jboss.msc.service.ServiceBuilder;
import org.jboss.msc.service.ServiceController.Mode;
import org.jboss.msc.service.ServiceName;
import org.jboss.msc.service.ServiceTarget;
import org.jboss.msc.service.StartContext;
Expand All @@ -49,7 +48,7 @@
* @author alessio.soldano@jboss.com
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
public final class EndpointDeployService implements Service<DeploymentUnit> {
public final class EndpointDeployService implements Service {

private final ServiceName name;
private final DeploymentUnit unit;
Expand All @@ -59,11 +58,6 @@ private EndpointDeployService(final String context, final DeploymentUnit unit) {
this.unit = unit;
}

@Override
public DeploymentUnit getValue() {
return unit;
}

public ServiceName getName() {
return name;
}
Expand Down Expand Up @@ -104,9 +98,9 @@ public static DeploymentUnit install(final ServiceTarget serviceTarget, final St
}
}
final EndpointDeployService service = new EndpointDeployService(context, unit);
final ServiceBuilder<DeploymentUnit> builder = serviceTarget.addService(service.getName(), service);
final ServiceBuilder builder = serviceTarget.addService(service.getName());
builder.requires(WSServices.CONFIG_SERVICE);
builder.setInitialMode(Mode.ACTIVE);
builder.setInstance(service);
builder.install();
return unit;
}
Expand Down

0 comments on commit 8bcbb79

Please sign in to comment.