我没有太多的经验和辛迪格一起工作,我会尽力帮助。
Apache Shindig的用途
Google Guice
作为依赖注入框架,这使得覆盖Shindig服务实现变得简单。使用google guice,您可以构建自己的模块并将它们注入到shindig中。
可能,你需要延长
org.apache.shindig.gadgets.render.ProxyRenderer
实现
org.netmera.portal.shindig.RequestPipeline
,
org.apache.shindig.gadgets.templates.TemplateModule
越来越多…
我想,为了吸引您的服务,需要这样一个模块。
在这里,
米汉德尔
是我自己的管理者:
/**
* Provides social api component injection.
*/
public class MySocialApiModule extends SocialApiGuiceModule {
/*
* (non-Javadoc)
*
* @see
* org.apache.shindig.social.core.config.SocialApiGuiceModule#configure()
*/
@Override
protected void configure(){
this.bind(ParameterFetcher.class).annotatedWith(Names.named("DataServiceServlet")).to(DataServiceServletFetcher.class);
this.bind(Boolean.class).annotatedWith(Names.named(AnonymousAuthenticationHandler.ALLOW_UNAUTHENTICATED)).toInstance(Boolean.TRUE);
this.bind(XStreamConfiguration.class).to(XStream081Configuration.class);
this.bind(BeanConverter.class).annotatedWith(Names.named("shindig.bean.converter.xml")).to(BeanXStreamConverter.class);
this.bind(BeanConverter.class).annotatedWith(Names.named("shindig.bean.converter.json")).to(BeanJsonConverter.class);
this.bind(BeanConverter.class).annotatedWith(Names.named("shindig.bean.converter.atom")).to(BeanXStreamAtomConverter.class);
this.bind(new TypeLiteral<List<AuthenticationHandler>>(){}).toProvider(AuthenticationHandlerProvider.class);
final Multibinder<Object> handlerBinder = Multibinder.newSetBinder(this.binder(), Object.class, Names.named("org.apache.shindig.handlers"));
for (final Class handler : this.getHandlers()) {
handlerBinder.addBinding().toInstance(handler);
}
this.bind(OAuthDataStore.class).to(MyOAuthDataStore.class);
}
/**
* Hook to provide a Set of request handlers. Subclasses may override to add
* or replace additional handlers.
*/
@Override
protected Set<Class<?>> getHandlers(){
return ImmutableSet.<Class<?>> of(ActivityHandler.class, AppDataHandler.class, MyPersonHandler.class, MessageHandler.class, MyHandler.class, ACLHandler.class);
}
}
霍维尔,你应该深入了解
狂欢节
假装要做你想要的东西。在Web上有很多例子解释了如何用guice扩展和配置shindig。