RE: Karaf Cellar - Overriding BundleEventHandler

2016-07-18 Thread Jean-Baptiste Onofré


Hi Sergiy 
I have a jira about that and it's plan for cellar 4.0.2. Basically the trick is 
to use a command event instead of a simple event (as I do for producer, etc).
I advise to wait cellar 4.0.2.
RegardsJB 


Sent from my Samsung device

 Original message 
From: Sergiy Shyrkov  
Date: 18/07/2016  18:10  (GMT+01:00) 
To: user@karaf.apache.org 
Subject: Karaf Cellar - Overriding BundleEventHandler 

Hello,

I would like to override or extend the functionality of the:
org.apache.karaf.cellar.bundle.BundleEventHandler

in order to implement "synchronous" handling in our code as we expect  
bundle operations to complete before the call returns. I was already  
asking in the list about implementing synchronous behaviour for bundle  
operations, but have not got any hints so far.

I am able to register my own handler implementation for the  
ClusterBundleEvent.class and disable via org.apache.karaf.cellar.node.cfg  
the original one.

But my issue is that the EventHandlerServiceRegistry stores only one  
handler instance per event type. So whenever my instance is registered  
first, the registration of the disabled BundleEventHandler overwrites it  
in the registry.

Would someone have any hints on how to solve this "issue" without forking  
the code base of Cellar?

Thank you in advance for any clues!


Kind regards
Sergiy


-- 
Sergiy Shyrkov
Software Architect
Jahia Solutions Group SA
http://www.jahia.com


Karaf Cellar - Overriding BundleEventHandler

2016-07-18 Thread Sergiy Shyrkov

Hello,

I would like to override or extend the functionality of the:
org.apache.karaf.cellar.bundle.BundleEventHandler

in order to implement "synchronous" handling in our code as we expect  
bundle operations to complete before the call returns. I was already  
asking in the list about implementing synchronous behaviour for bundle  
operations, but have not got any hints so far.


I am able to register my own handler implementation for the  
ClusterBundleEvent.class and disable via org.apache.karaf.cellar.node.cfg  
the original one.


But my issue is that the EventHandlerServiceRegistry stores only one  
handler instance per event type. So whenever my instance is registered  
first, the registration of the disabled BundleEventHandler overwrites it  
in the registry.


Would someone have any hints on how to solve this "issue" without forking  
the code base of Cellar?


Thank you in advance for any clues!


Kind regards
Sergiy


--
Sergiy Shyrkov
Software Architect
Jahia Solutions Group SA
http://www.jahia.com


Re: Removal of start levels from Karaf 4.0.2 onwards - transaction manager not available in time

2016-07-18 Thread Christian Schneider

Hi Tim,

you should create such a feature in the tx-control code in Aries. For 
example the Aries jpa code already has such a feature now.
This allows people to install their desired version independently from 
the karaf version.


As soon as you have this feature I can then add it to the karaf short 
list to make it easier to install it.

For example you can install aries jpa using
feature:repo-add aries-jpa 2.4.0
instead of
feature:repo-add mvn:org.apache.aries.jpa/jpa-features/2.4.0/xml/features

It could be like
feature:install aries-tx-control 1.0.0

Christian

On 18.07.2016 11:31, Timothy Ward wrote:

Hi Jochen,

Sorry I missed this reply last week, I only noticed it after Guillaume’s reply.

I’m not a Karaf committer, nor do I actually use Karaf, so there is no Karaf 
feature for Transaction Control as yet. I know that some people have been 
playing with it though, and it should be pretty easy to put one together.

The local and XA transaction control services are both independently deployable 
(you’ll only want one of them).


 org.apache.aries.tx-control
 tx-control-service-local
 0.0.1


And you’ll also want a JPA Resource provider to give you JPA support:


 org.apache.aries.tx-control
 tx-control-provider-jdbc-local
 0.0.1


This depends on having a JPA container (Aries JPA 2.4.0 works well) and a JPA 
provider (it’s tested with EclipseLink, Hibernate and OpenJPA.



I haven't looked into the
transaction control service up to now, and don't know whether e.g. the
persistence bundles can stay as they are.


Yes, the JPA support builds on the JPA service, so persistence bundles (i.e. 
bundles with Meta-Persistence) should be packaged in the same way.


Since we already are pretty close to a
release date, we'd rather like not to change code. However, it might be naiv
to think that such an easy exchange is possible

It won’t be directly possible. Transaction control is an explicit transaction 
management framework, and does require some code to define the transactional 
work. You will also need to obtain your EntityManager instances using a 
JPAEntityManagerProvider service.

These changes are not large (a few lines of code) but they are necessary.

Regards,

Tim


On 11 Jul 2016, at 17:17, jochenw  wrote:

Hi Timothy,

sounds interesting. Is there a description which Karaf features to use to
replace the "transaction" feature? Since we already are pretty close to a
release date, we'd rather like not to change code. However, it might be naiv
to think that such an easy exchange is possible - I haven't looked into the
transaction control service up to now, and don't know whether e.g. the
persistence bundles can stay as they are.


Guillaume, here from the persistence.xml:



osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/myXADataSource)


osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/myDataSource)

META-INF/orm.xml
someclass

true










and from the blueprint.xml:













Currently we are forced to stay with Aries JPA 1.x, since our persistence
bundles do not yet define the persistence units via annotation - having a
growing and very well distributed project. If JPA 1.x + transaction manager
has known deficienciey regarding handling of service dynamism, then it could
be argued whether start levels have been removed anyways (although they are
bad style, it might allow a smooth transition when leaving them in for older
versions and setting these to deprecated, instead of causing them not
working correctly by removing the start levels). However, from previous
discussions I have understood that our problems might not be so common, so
nobody else might have stumbled over them.

Regards,
Jochen



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Removal-of-start-levels-from-Karaf-4-0-2-onwards-transaction-manager-not-available-in-time-tp4047189p4047199.html
Sent from the Karaf - User mailing list archive at Nabble.com.



--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com



Re: Documentation for org.apache.cxf.osgi.cfg

2016-07-18 Thread Christian Schneider
It is used in the class ServletExporter in the http transport. You can 
see  the params in the source below.


See
https://github.com/apache/cxf/blob/master/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/ServletExporter.java

Christian

On 18.07.2016 10:53, Allan C. wrote:

Hi,

I am trying to find out what are the available parameters for 
configuration in the config file "org.apache.cxf.osgi.cfg". Would 
anyone know where to start? And which bundle is watching this 
configuration file?


Regards,
Allan C.



--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com



Documentation for org.apache.cxf.osgi.cfg

2016-07-18 Thread Allan C.
Hi,

I am trying to find out what are the available parameters for configuration
in the config file "org.apache.cxf.osgi.cfg". Would anyone know where to
start? And which bundle is watching this configuration file?

Regards,
Allan C.


Helping Spread the Word about Apachecon EU 2016

2016-07-18 Thread Sharan Foga
Hi Everyone

I'm forwarding the following message on behalf of Rich Bowen and the 
Apachecon team
==

As you are aware, we are holding ApacheCon in Seville in November. While this 
seems like a long way away, it is critical that we get on people's calendar 
now, so that they can plan, get budget approval, and spread the word to their 
contacts.

Here's how you can help.

If you Tweet, please consider using some of the following sample tweets to get 
the word out:


Save the date. #ApacheCon is coming to Seville, November 14-18 2016. 
http://apachecon.com/

Come join me at @ApacheCon in Seville in November. http://apachecon.com/

#ApacheBigData is the best place to learn what's next in the world of big data. 
November 14-16 in Seville http://apachecon.com/

 @TheASF is 300 projects strong and growing. Come learn about all of them at 
@ApacheCon in Seville - http://apachecon.com/


Follow @ApacheCon and @TheASF, and retweet mentions of ApacheCon, to spread the 
word. 


If you use other social media platforms, share the URLs of the events and their 
CFPs, to collect the broadest possible audience for our events, as well as 
getting the best content:


Big Data: Website: 
http://events.linuxfoundation.org/events/apache-big-data-europe
CFP: http://events.linuxfoundation.org/events/apache-big-data-europe/program/cfp


ApacheCon: Website: http://events.linuxfoundation.org/events/apachecon-europe
CFP: http://events.linuxfoundation.org/events/apachecon-europe/program/cfp


And, finally, if your employer benefits from the work that we do at Apache, or 
is looking for the brightest software developers in the industry, encourage 
them to sponsor the event. Sponsorship is available at all levels. Have them 
contact me at e...@apache.org for a prospectus, and I'll make the right 
introductions. Sponsors in the past include … well, everyone. You have to go 
pretty deep into the Forbes Technology list ( 
http://fortune.com/2015/06/13/fortune-500-tech/ ) to find a company that hasn't 
sponsored ApacheCon.

==

Thanks
Sharan



Re: Removal of start levels from Karaf 4.0.2 onwards - transaction manager not available in time

2016-07-18 Thread Guillaume Nodet
The depend-on flag on the bean element can be used for that.
The JPA 2.x Aries bundles should solve the service dependency problem and
be better integrated with the pax-jdbc config stuff.

2016-07-11 9:37 GMT+02:00 jochenw :

> Hello,
>
> start levels have been removed for a number of bundles in the Karaf
> enterprise features. In principle a good idea (sometimes start levels are
> even seen as anti-pattern in OSGi).
>
> However, sometimes I now face the issue that the transaction service is
> missing when one of my persistence bundle start up, and some initial
> writing
> to the DB fails (currently, I don't have the stack trace available, but it
> says "no transaction associated with this thread"). Is does not happen
> every
> time (looks more frequent if the machine is busy with other things, or on
> devices with restricted computing power). Giving the data source /
> persistence bundles higher start levels than 80 does not help.
>
> I'm using pax-jdbc to create the data source (however, not pax-jdbc-config,
> since also that turned out too slow sometimes to create the data sources
> before the persistence bundles started).
>
> Might be a dumb question: how can make the data source bundle (data source
> created via blueprint.xml) waiting for the transaction manager being
> available? And / or (even better, since then I could switch to using
> pax-jdbc-config for creation of the data source): how can I make my
> persistence bundles waiting for the datasource being available? I only have
> the blueprint.xml (for the data source) and the persistence.xml (for the
> persistence unit), and currently don't see a possibility to make them wait
> for their dependencies.
>
> Currently, I'm using JPA 1.0.4, transaction 1.3.0.
>
> From my datasource blueprint.xml:
>
>  class="org.apache.commons.dbcp2.managed.BasicManagedDataSource"
> destroy-method="close">
> 
> 
> 
>  value="org.postgresql.Driver" />
> 
> 
> 
>  ref="transactionManager" />
> 
>
>  interface="javax.transaction.TransactionManager" />
>
>
> Regards,
> Jochen
>
>
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Removal-of-start-levels-from-Karaf-4-0-2-onwards-transaction-manager-not-available-in-time-tp4047189.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 

Guillaume Nodet

Red Hat, Open Source Integration

Email: gno...@redhat.com
Web: http://fusesource.com
Blog: http://gnodet.blogspot.com/