The Camel Netty component permits it to be used in Camel routes (I've pasted
the configuration class below for illustration). In the case of the shared
configuration and HTTP server in an OSGi context, the server can be exported
to the registry and then used in Camel routes for REST DSLs. The
configuration has a number of default values. That works in Camel/Blueprint
obviously. It may be less than useful for pure OSGi. 

Unfortunately, Camel itself doesn't have a pure DS implementation. Perhaps I
misunderstood your use of DS as a factory. It may be that if the developers
of PAX JDBC were writing it from scratch today they'd use DS but it isn't a
Camel aware component either. 

The PAX JDBC source just uses straight up Java which obviously will work for
the service dynamism. Because the Netty Camel server has Camel annotations
it may not be a good candidate for this sort of factory though. Dunno. 

https://github.com/ops4j/org.ops4j.pax.jdbc/blob/master/pax-jdbc-config/src/main/java/org/ops4j/pax/jdbc/config/impl/Activator.java

@UriParams
public class NettyServerBootstrapConfiguration implements Cloneable {
    public static final String DEFAULT_ENABLED_PROTOCOLS =
"TLSv1,TLSv1.1,TLSv1.2";

    @UriPath(enums = "tcp,udp") @Metadata(required = "true")
    protected String protocol;
    @UriPath @Metadata(required = "true")
    protected String host;
    @UriPath @Metadata(required = "true")
    protected int port;
    @UriParam(label = "consumer")
    protected boolean broadcast;
    @UriParam(label = "advanced", defaultValue = "65536")
    protected int sendBufferSize = 65536;
    @UriParam(label = "advanced", defaultValue = "65536")
    protected int receiveBufferSize = 65536;
    @UriParam(label = "advanced")
    protected int receiveBufferSizePredictor;
    @UriParam(label = "consumer,advanced", defaultValue = "1")
    protected int bossCount = 1;
    @UriParam(label = "advanced")
    protected int workerCount;
    @UriParam(defaultValue = "true")
    protected boolean keepAlive = true;
    @UriParam(defaultValue = "true")
    protected boolean tcpNoDelay = true;
    @UriParam(defaultValue = "true")
    protected boolean reuseAddress = true;
    @UriParam(label = "producer", defaultValue = "10000")
    protected int connectTimeout = 10000;
    @UriParam(label = "consumer,advanced")
    protected int backlog;
    @UriParam(label = "consumer,advanced")
    protected ServerInitializerFactory serverInitializerFactory;
    @UriParam(label = "consumer,advanced")
    protected NettyServerBootstrapFactory nettyServerBootstrapFactory;
    @UriParam(label = "advanced", prefix = "option.", multiValue = true)
    protected Map<String, Object> options;
    // SSL options is also part of the server bootstrap as the server
listener on port X is either plain or SSL
    @UriParam(label = "security")
    protected boolean ssl;
    @UriParam(label = "security")
    protected boolean sslClientCertHeaders;
    @UriParam(label = "security")
    protected SslHandler sslHandler;
    @UriParam(label = "security")
    protected SSLContextParameters sslContextParameters;
    @UriParam(label = "consumer,security")
    protected boolean needClientAuth;
    @UriParam(label = "security")
    protected File keyStoreFile;
    @UriParam(label = "security")
    protected File trustStoreFile;
    @UriParam(label = "security")
    protected String keyStoreResource;
    @UriParam(label = "security")
    protected String trustStoreResource;
    @UriParam(label = "security")
    protected String keyStoreFormat;
    @UriParam(label = "security")
    protected String securityProvider;
    @UriParam(defaultValue = DEFAULT_ENABLED_PROTOCOLS, label = "security")
    protected String enabledProtocols = DEFAULT_ENABLED_PROTOCOLS;
    @UriParam(label = "security", secret = true)
    protected String passphrase;
    @UriParam(label = "advanced")
    protected boolean nativeTransport;
    @UriParam(label = "consumer,advanced")
    protected EventLoopGroup bossGroup;
    @UriParam(label = "advanced")
    protected EventLoopGroup workerGroup;
    @UriParam(label = "advanced")
    protected ChannelGroup channelGroup;
    @UriParam(label = "consumer,advanced")
    protected String networkInterface;
    @UriParam(label = "consumer", defaultValue = "true")
    private boolean reconnect = true;
    @UriParam(label = "consumer", defaultValue = "10000")
    private int reconnectInterval = 10000;




--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Reply via email to