/** * @return the name of the service */ public String getServiceName() { return AgoravaContext.getQualifierToService().get(getServiceQualifier()); }
/** * * @param clazz provider qualifier class for which we're looking service name * @return the service name */ public static String getServiceFromClass(Class<? extends Annotation> clazz) { return getQualifierToService().get(getClassToQualifierQualifier().get(clazz)); }
/** * Set the provider qualifier for the session * * @param qualifier with {@link org.agorava.api.atinject.ProviderRelated} meta-annotation * @return this builder * @throws ProviderMismatchException if parameter is null or if no provider exists for this qualifier */ public Builder qualifier(Annotation qualifier) throws ProviderMismatchException { this.qualifier = qualifier; if (qualifier != null && AgoravaContext.getQualifierToService().containsKey(qualifier)) return this; else throw new ProviderMismatchException("No provider found for qualifier : " + qualifier); }
@Override public OAuthAppSettings produce(CreationalContext<OAuthAppSettings> ctx) { builder.name(getQualifierToService().get(qual)); OAuthAppSettings newSettings = builder.build(); ctx.push(newSettings); return newSettings; }
@Override public OAuthAppSettings produce(CreationalContext<OAuthAppSettings> ctx) { OAuthAppSettings settings = oldProducer.produce(ctx); OAuthAppSettings newSettings = new SimpleOAuthAppSettingsBuilder().readFromSettings(settings). qualifier(qual). name(AgoravaContext.getQualifierToService().get(qual)).build(); ctx.push(newSettings); return newSettings; }