Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

Contribute multiple collections in the same service?

$
0
0
Hello,

I would like to contribute 2 collections to a service, but I am afraid
Tapestry only supports one collection to be contributed. Am I right?

My service constructor is like this:

public HazelcastConfigServiceImpl(
final Collection<MapConfig> mapConfigs,
final Collection<HazelcastConfigurer> hzConfigurers) { ... }

And I try to contribute the hzConfigurers this way:

@Contribute(HazelcastConfigService.class)
public static void
contributeExecutorConfig(Configuration<HazelcastConfigurer> hzConfigurers)

hzConfigurers.add(new HazelcastConfigurer()

@Override
public void configure(Config config)

config.addExecutorConfig(
new ExecutorConfig(RankingsConstants.RANKINGS_EXECUTOR_SERVICE_NAME)
.setCorePoolSize(5)
.setMaxPoolSize(5)
);

});

But I get this exception:

Caused by: org.apache.tapestry5.ioc.util.UnknownValueException: Could not
find a coercion from type
com.mobivery.malcom.categories.rankings.workers.services.MalcomRankingsWorkersModule$1
to type com.hazelcast.config.MapConfig.

It seems it is trying to insert my HazelcastConfigurer into
the mapConfigs when it should go to the hzConfigurers.

Thank you

-- Ferran

Viewing all articles
Browse latest Browse all 5648

Trending Articles