[jira] [Commented] (FELIX-5349) add ManagedServiceFactory to HTTP service

2016-09-18 Thread Carsten Ziegeler (JIRA)

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

Carsten Ziegeler commented on FELIX-5349:
-

Thanks [~db82407] I've applied your patch

> add ManagedServiceFactory to HTTP service
> -
>
> Key: FELIX-5349
> URL: https://issues.apache.org/jira/browse/FELIX-5349
> Project: Felix
>  Issue Type: New Feature
>  Components: HTTP Service
>Affects Versions: http.base-3.0.12, http.jetty-3.2.4
>Reporter: Derek Baum
>Assignee: Carsten Ziegeler
>Priority: Minor
> Fix For: http.base-3.0.14, http.jetty-3.2.6, http.bridge-3.0.14
>
> Attachments: factory.patch, factory2.patch
>
>
> I need to run multiple HTTP services, with different configurations.
> I was surprised to find that felix.http.jetty does not provide a 
> ManagedServiceFactory and so were others as indicated in this stack overflow 
> conversation: 
> http://stackoverflow.com/questions/20074211/osgi-http-bundle-bind-to-two-ports
> I have experimented with creating a ManagedServiceFactory for the HTTP 
> service myself. It is difficult to do externally to the http.jetty bundle, as 
> it requires access to internal packages.
> I have therefore created a small patch to revision 1760954 which adds a 
> ManagedServiceFactory, without changing any of the existing functionality of 
> the ManagedService. This allows multiple http.jetty instances to be 
> configured using WebConsole, fileinstall or other config admin clients.
> I have also added a new configuration property: org.apache.felix.http.name,
> which is added as a service property to the HTTP runtime instance. This makes 
> it easier to target a specific HTTP whiteboard service than filtering on the 
> port:
> HTTP_WHITEBOARD_TARGET + "=(org.apache.felix.http.name=web1)"
> I would be grateful if you would consider adding this functionality.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FELIX-5349) add ManagedServiceFactory to HTTP service

2016-09-16 Thread Carsten Ziegeler (JIRA)

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

Carsten Ziegeler commented on FELIX-5349:
-

I've changed the http.base code a little bit to make the code slightly cleaner 
and the JettyServiceStarter does not need to extend the activator anymore

> add ManagedServiceFactory to HTTP service
> -
>
> Key: FELIX-5349
> URL: https://issues.apache.org/jira/browse/FELIX-5349
> Project: Felix
>  Issue Type: New Feature
>  Components: HTTP Service
>Affects Versions: http.base-3.0.12, http.jetty-3.2.4
>Reporter: Derek Baum
>Assignee: Carsten Ziegeler
>Priority: Minor
> Fix For: http.base-3.0.14, http.jetty-3.2.6, http.bridge-3.0.14
>
> Attachments: factory.patch
>
>
> I need to run multiple HTTP services, with different configurations.
> I was surprised to find that felix.http.jetty does not provide a 
> ManagedServiceFactory and so were others as indicated in this stack overflow 
> conversation: 
> http://stackoverflow.com/questions/20074211/osgi-http-bundle-bind-to-two-ports
> I have experimented with creating a ManagedServiceFactory for the HTTP 
> service myself. It is difficult to do externally to the http.jetty bundle, as 
> it requires access to internal packages.
> I have therefore created a small patch to revision 1760954 which adds a 
> ManagedServiceFactory, without changing any of the existing functionality of 
> the ManagedService. This allows multiple http.jetty instances to be 
> configured using WebConsole, fileinstall or other config admin clients.
> I have also added a new configuration property: org.apache.felix.http.name,
> which is added as a service property to the HTTP runtime instance. This makes 
> it easier to target a specific HTTP whiteboard service than filtering on the 
> port:
> HTTP_WHITEBOARD_TARGET + "=(org.apache.felix.http.name=web1)"
> I would be grateful if you would consider adding this functionality.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FELIX-5349) add ManagedServiceFactory to HTTP service

2016-09-16 Thread Derek Baum (JIRA)

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

Derek Baum commented on FELIX-5349:
---

I was just trying to keep the existing Activator behaviour, but yes, it should 
shutdown all instances when the bundle is stopped. 

And I think you're right about needing synchronisation.

BTW, when testing this I was using configadmin 1.8.8, which didn't contain the 
fix for FELIX-5088 - CaseSensitiveDictionary should implement equals(). This 
caused JettyConfig.update(Dictionary props) to think that the props had not 
changed. It works fine with configadmin-1.8.10.

> add ManagedServiceFactory to HTTP service
> -
>
> Key: FELIX-5349
> URL: https://issues.apache.org/jira/browse/FELIX-5349
> Project: Felix
>  Issue Type: New Feature
>  Components: HTTP Service
>Affects Versions: http.base-3.0.12, http.jetty-3.2.4
>Reporter: Derek Baum
>Assignee: Carsten Ziegeler
>Priority: Minor
> Fix For: http.base-3.0.14, http.jetty-3.2.6
>
> Attachments: factory.patch
>
>
> I need to run multiple HTTP services, with different configurations.
> I was surprised to find that felix.http.jetty does not provide a 
> ManagedServiceFactory and so were others as indicated in this stack overflow 
> conversation: 
> http://stackoverflow.com/questions/20074211/osgi-http-bundle-bind-to-two-ports
> I have experimented with creating a ManagedServiceFactory for the HTTP 
> service myself. It is difficult to do externally to the http.jetty bundle, as 
> it requires access to internal packages.
> I have therefore created a small patch to revision 1760954 which adds a 
> ManagedServiceFactory, without changing any of the existing functionality of 
> the ManagedService. This allows multiple http.jetty instances to be 
> configured using WebConsole, fileinstall or other config admin clients.
> I have also added a new configuration property: org.apache.felix.http.name,
> which is added as a service property to the HTTP runtime instance. This makes 
> it easier to target a specific HTTP whiteboard service than filtering on the 
> port:
> HTTP_WHITEBOARD_TARGET + "=(org.apache.felix.http.name=web1)"
> I would be grateful if you would consider adding this functionality.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FELIX-5349) add ManagedServiceFactory to HTTP service

2016-09-16 Thread Derek Baum (JIRA)

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

Derek Baum commented on FELIX-5349:
---

Yes, I'm using the same PID. This also means that the existing Metadata is 
available in webconsole when creating a new instance.

Enforcing the name property would be useful, otherwise it's difficult to target 
a specific whiteboard instance without using the port in the filter.


If you only want to use the ManagedServiceFactory, then setting 
org.apache.felix.http.enable=false, stops the ManagedService instance from 
starting; although it can be re-enabled from webconsole/config admin.

I did consider adding a property that would eenable either the existing 
ManagedService ot the new ManagedServiceFactory, but I don't think that's 
necessary.


The ManagedServiceFactory could also check for conflicting configurations, for 
example a port that conflicts with an existing instance.

> add ManagedServiceFactory to HTTP service
> -
>
> Key: FELIX-5349
> URL: https://issues.apache.org/jira/browse/FELIX-5349
> Project: Felix
>  Issue Type: New Feature
>  Components: HTTP Service
>Affects Versions: http.base-3.0.12, http.jetty-3.2.4
>Reporter: Derek Baum
>Assignee: Carsten Ziegeler
>Priority: Minor
> Fix For: http.base-3.0.14, http.jetty-3.2.6
>
> Attachments: factory.patch
>
>
> I need to run multiple HTTP services, with different configurations.
> I was surprised to find that felix.http.jetty does not provide a 
> ManagedServiceFactory and so were others as indicated in this stack overflow 
> conversation: 
> http://stackoverflow.com/questions/20074211/osgi-http-bundle-bind-to-two-ports
> I have experimented with creating a ManagedServiceFactory for the HTTP 
> service myself. It is difficult to do externally to the http.jetty bundle, as 
> it requires access to internal packages.
> I have therefore created a small patch to revision 1760954 which adds a 
> ManagedServiceFactory, without changing any of the existing functionality of 
> the ManagedService. This allows multiple http.jetty instances to be 
> configured using WebConsole, fileinstall or other config admin clients.
> I have also added a new configuration property: org.apache.felix.http.name,
> which is added as a service property to the HTTP runtime instance. This makes 
> it easier to target a specific HTTP whiteboard service than filtering on the 
> port:
> HTTP_WHITEBOARD_TARGET + "=(org.apache.felix.http.name=web1)"
> I would be grateful if you would consider adding this functionality.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FELIX-5349) add ManagedServiceFactory to HTTP service

2016-09-16 Thread Carsten Ziegeler (JIRA)

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

Carsten Ziegeler commented on FELIX-5349:
-

I've applied your patch. I think we can improve this a little bit more, e.g. 
cleaning up/shutting down all jetty services if the jetty bundle is stopped. 
I'm not 100% sure but I think we might also need synchronization in the 
JettyManagedServiceFactory as updated might be called in parallel

> add ManagedServiceFactory to HTTP service
> -
>
> Key: FELIX-5349
> URL: https://issues.apache.org/jira/browse/FELIX-5349
> Project: Felix
>  Issue Type: New Feature
>  Components: HTTP Service
>Affects Versions: http.base-3.0.12, http.jetty-3.2.4
>Reporter: Derek Baum
>Assignee: Carsten Ziegeler
>Priority: Minor
> Fix For: http.base-3.0.14, http.jetty-3.2.6
>
> Attachments: factory.patch
>
>
> I need to run multiple HTTP services, with different configurations.
> I was surprised to find that felix.http.jetty does not provide a 
> ManagedServiceFactory and so were others as indicated in this stack overflow 
> conversation: 
> http://stackoverflow.com/questions/20074211/osgi-http-bundle-bind-to-two-ports
> I have experimented with creating a ManagedServiceFactory for the HTTP 
> service myself. It is difficult to do externally to the http.jetty bundle, as 
> it requires access to internal packages.
> I have therefore created a small patch to revision 1760954 which adds a 
> ManagedServiceFactory, without changing any of the existing functionality of 
> the ManagedService. This allows multiple http.jetty instances to be 
> configured using WebConsole, fileinstall or other config admin clients.
> I have also added a new configuration property: org.apache.felix.http.name,
> which is added as a service property to the HTTP runtime instance. This makes 
> it easier to target a specific HTTP whiteboard service than filtering on the 
> port:
> HTTP_WHITEBOARD_TARGET + "=(org.apache.felix.http.name=web1)"
> I would be grateful if you would consider adding this functionality.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FELIX-5349) add ManagedServiceFactory to HTTP service

2016-09-15 Thread Carsten Ziegeler (JIRA)

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

Carsten Ziegeler commented on FELIX-5349:
-

Thanks for your patch, [~db82407] Really appreciated. If I see it correctly, 
you're using the same PID for the existing configuration and for the factory 
configurations - which means that this is fully compatible with what we have 
today.
I'm wondering if we should enforce the name property for factory configurations 
and do some checking like if the same name is used twice?

> add ManagedServiceFactory to HTTP service
> -
>
> Key: FELIX-5349
> URL: https://issues.apache.org/jira/browse/FELIX-5349
> Project: Felix
>  Issue Type: New Feature
>  Components: HTTP Service
>Affects Versions: http.base-3.0.12, http.jetty-3.2.4
>Reporter: Derek Baum
>Assignee: Carsten Ziegeler
>Priority: Minor
> Fix For: http.base-3.0.14, http.jetty-3.2.6
>
> Attachments: factory.patch
>
>
> I need to run multiple HTTP services, with different configurations.
> I was surprised to find that felix.http.jetty does not provide a 
> ManagedServiceFactory and so were others as indicated in this stack overflow 
> conversation: 
> http://stackoverflow.com/questions/20074211/osgi-http-bundle-bind-to-two-ports
> I have experimented with creating a ManagedServiceFactory for the HTTP 
> service myself. It is difficult to do externally to the http.jetty bundle, as 
> it requires access to internal packages.
> I have therefore created a small patch to revision 1760954 which adds a 
> ManagedServiceFactory, without changing any of the existing functionality of 
> the ManagedService. This allows multiple http.jetty instances to be 
> configured using WebConsole, fileinstall or other config admin clients.
> I have also added a new configuration property: org.apache.felix.http.name,
> which is added as a service property to the HTTP runtime instance. This makes 
> it easier to target a specific HTTP whiteboard service than filtering on the 
> port:
> HTTP_WHITEBOARD_TARGET + "=(org.apache.felix.http.name=web1)"
> I would be grateful if you would consider adding this functionality.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)