Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Custom query handlers on arbitrary container?
[CDO] Custom query handlers on arbitrary container? [message #1063736] Thu, 13 June 2013 23:00 Go to next message
Alex Mising name is currently offline Alex Mising nameFriend
Messages: 51
Registered: August 2009
Member
It seems that custom query handlers have be registered on IPluginContainer.INSTANCE, if using a different container
server's ContainerQueryHandlerProvider.getQueryHandler does not seem to be able to find them:

Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found: org.eclipse.emf.cdo.server.queryHandlerFactories[*name removed*]
        at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:228) [util-3.3.0-v20130503-1908.jar:]
        at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:562) [util-3.3.0-v20130503-1908.jar:]
        at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:320) [util-3.3.0-v20130503-1908.jar:]
        at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:301) [util-3.3.0-v20130503-1908.jar:]
        at org.eclipse.emf.cdo.spi.server.ContainerQueryHandlerProvider.getQueryHandler(ContainerQueryHandlerProvider.java:46) [server-4.2.0-v20130503-1908.jar:]
        at org.eclipse.emf.cdo.internal.server.Repository.getQueryHandler(Repository.java:993) [server-4.2.0-v20130503-1908.jar:]
        at org.eclipse.emf.cdo.internal.server.QueryManager$QueryContext.run(QueryManager.java:293) [server-4.2.0-v20130503-1908.jar:]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [rt.jar:1.7.0_13]
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) [rt.jar:1.7.0_13]
        at java.util.concurrent.FutureTask.run(Unknown Source) [rt.jar:1.7.0_13]
        ... 3 more

Is this by design or should one be able to register custom query handlers for an arbitrary container?
Re: [CDO] Custom query handlers on arbitrary container? [message #1063754 is a reply to message #1063736] Fri, 14 June 2013 06:37 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 5590
Registered: July 2009
Senior Member
Am 14.06.2013 01:00, schrieb Alex Mising name:
> It seems that custom query handlers have be registered on IPluginContainer.INSTANCE, if using a different container
> server's ContainerQueryHandlerProvider.getQueryHandler does not seem to be able to find them:
>
> Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found:
> org.eclipse.emf.cdo.server.queryHandlerFactories[*name removed*]
> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:228)
> [util-3.3.0-v20130503-1908.jar:]
> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:562)
> [util-3.3.0-v20130503-1908.jar:]
> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:320)
> [util-3.3.0-v20130503-1908.jar:]
> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:301)
> [util-3.3.0-v20130503-1908.jar:]
> at
> org.eclipse.emf.cdo.spi.server.ContainerQueryHandlerProvider.getQueryHandler(ContainerQueryHandlerProvider.java:46)
> [server-4.2.0-v20130503-1908.jar:]
> at org.eclipse.emf.cdo.internal.server.Repository.getQueryHandler(Repository.java:993)
> [server-4.2.0-v20130503-1908.jar:]
> at org.eclipse.emf.cdo.internal.server.QueryManager$QueryContext.run(QueryManager.java:293)
> [server-4.2.0-v20130503-1908.jar:]
> at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [rt.jar:1.7.0_13]
> at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) [rt.jar:1.7.0_13]
> at java.util.concurrent.FutureTask.run(Unknown Source) [rt.jar:1.7.0_13]
> ... 3 more
> Is this by design or should one be able to register custom query handlers for an arbitrary container?

If you're using a container different from IPluginContainer.INSTANCE you need to inject a respective
IQueryHandlerProvider into the repository, e.g.:

IManagedContainer myContainer = ...;
InternalRepository repository = ...;
repository.setQueryHandlerProvider(new ContainerQueryHandlerProvider(myContainer));

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Previous Topic:EMF Validation Framework - Documentation
Next Topic:Programmatically sync EMF editors
Goto Forum:
  


Current Time: Mon Dec 22 10:03:38 GMT 2014

Powered by FUDForum. Page generated in 0.02003 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software