[ 
https://issues.apache.org/jira/browse/CALCITE-2284?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16461635#comment-16461635
 ] 

ASF GitHub Bot commented on CALCITE-2284:
-----------------------------------------

Github user aaraujo commented on a diff in the pull request:

    https://github.com/apache/calcite-avatica/pull/46#discussion_r185642804
  
    --- Diff: 
server/src/main/java/org/apache/calcite/avatica/server/ServerCustomizer.java ---
    @@ -0,0 +1,32 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to you under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.calcite.avatica.server;
    +
    +import org.eclipse.jetty.server.Server;
    +
    +/**
    + * Callback for customizing a Jetty {@link Server}.
    + */
    +public interface ServerCustomizer {
    +  /**
    +   * Customize the server during initialization.
    +   * @param server The server to customize
    +   */
    +  void customize(Server server);
    --- End diff --
    
    > Avatica's API should not strictly depend on an implementation details (in 
this case, that Jetty is being used)
    
    Yeah, I did not think that was ideal either. Wanted to get some feedback 
before spending time making the Builder generic.
    
     > I think deprecating HttpServer and making it JettyHttpServer instead is 
the right avenue (or something along those lines).
    
    Pushed another commit for feedback on the API. It makes the Builder generic 
without changing too much of the existing API. It hides the fact that Avatica 
is using Jetty most of the time, but also lets "power users" customize the 
underlying jetty Server using a new API. More could be done to truly 
hide/abstract Jetty, but this seems to meet your other criteria without 
introducing too much change.


> Allow Jetty Server to be customized before startup
> --------------------------------------------------
>
>                 Key: CALCITE-2284
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2284
>             Project: Calcite
>          Issue Type: Improvement
>          Components: avatica
>    Affects Versions: 1.11.0
>            Reporter: Alex Araujo
>            Priority: Critical
>         Attachments: CALCITE-2284.patch
>
>
> Avatica server options currently allow users to enable TLS with file based 
> key stores. In order to support additional options (in memory keystores, 
> dynamically loaded keys/certificates, etc.) Avatica should provide a callback 
> to customize the embedded Jetty server before starting it up.
>  
> This would be similar to how Spring Boot allows developers to customize the 
> embedded server.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to