Skip to content

Commit

Permalink
Fix the fallback factory to implement correct interface
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
  • Loading branch information
lukasj committed Apr 8, 2021
1 parent 4e60714 commit c25f096
Showing 1 changed file with 15 additions and 8 deletions.
Expand Up @@ -10,28 +10,30 @@

package com.sun.xml.ws.assembler.jaxws;

import com.sun.xml.ws.api.BindingID;
import com.sun.xml.ws.api.pipe.TubelineAssembler;
import com.sun.xml.ws.api.pipe.TubelineAssemblerFactory;
import com.sun.xml.ws.api.pipe.Tube;
import com.sun.xml.ws.assembler.dev.ClientTubelineAssemblyContext;
import com.sun.xml.ws.assembler.dev.ServerTubelineAssemblyContext;
import com.sun.xml.ws.assembler.dev.TubeFactory;
import com.sun.xml.ws.resources.TubelineassemblyMessages;
import jakarta.xml.ws.WebServiceException;
import java.util.logging.Logger;

/**
*
* @deprecated Use {@code com.sun.xml.ws.assembler.metro.jaxws.TransportTubeFactory} provided by metro-wsit instead.
*/
@Deprecated
public final class TransportTubeFactory extends TubelineAssemblerFactory {
public final class TransportTubeFactory implements TubeFactory {

private static final Logger LOG = Logger.getLogger(TransportTubeFactory.class.getName());

private final TubelineAssemblerFactory taf;
private final TubeFactory taf;

public TransportTubeFactory() {
super();
LOG.warning(TubelineassemblyMessages.MASM_0050_DEPRECATED_TUBE(TransportTubeFactory.class.getName(), "com.sun.xml.ws.assembler.metro.jaxws.TransportTubeFactory"));
try {
taf = (TubelineAssemblerFactory) Class.forName("com.sun.xml.ws.assembler.metro.jaxws.TransportTubeFactory").getConstructor().newInstance();
taf = (TubeFactory) Class.forName("com.sun.xml.ws.assembler.metro.jaxws.TransportTubeFactory").getConstructor().newInstance();
} catch (ReflectiveOperationException | SecurityException ex) {
LOG.fine(TubelineassemblyMessages.MASM_0014_UNABLE_TO_LOAD_CLASS("com.sun.xml.ws.assembler.metro.jaxws.TransportTubeFactory"));
// cannot work without this
Expand All @@ -41,8 +43,13 @@ public TransportTubeFactory() {


@Override
public TubelineAssembler doCreate(BindingID bindingId) {
return taf.doCreate(bindingId);
public Tube createTube(ClientTubelineAssemblyContext context) throws WebServiceException {
return taf.createTube(context);
}

@Override
public Tube createTube(ServerTubelineAssemblyContext context) throws WebServiceException {
return taf.createTube(context);
}

}

0 comments on commit c25f096

Please sign in to comment.