Here, in below code snippet, DirectoryControllers wait too much for getting referenced services available, if DirectoryControllers having one or two reference then it's OK but I will have around 10 service reference in DirectoryControllers component so it is taking too much time to start invalid configured services.
For every invalid referenced service, it tries three time to get activated reference service.
@Component(immediate = true, configurationPolicy = ConfigurationPolicy.IGNORE,name="directory.comp")
public class DirectoryControllers
{
@Reference(policy=ReferencePolicy.STATIC,cardinality=ReferenceCardinality.OPTIONAL,policyOption=ReferencePolicyOption.GREEDY)
private volatile IZimbra zimbra;
@Reference(policy=ReferencePolicy.STATIC,cardinality=ReferenceCardinality.OPTIONAL,policyOption=ReferencePolicyOption.GREEDY)
private volatile IOpenDJ opendj;
@Reference(policy=ReferencePolicy.STATIC,cardinality=ReferenceCardinality.OPTIONAL,policyOption=ReferencePolicyOption.GREEDY)
private volatile IOpenIDM openidm;
private ServletRegistration _registration;
@Activate void activate(BundleContext bc) throws ServletException, NamespaceException
{
AppProvisioners provisioners=new AppProvisioners(zimbra,openidm,opendj);
_registration = ServletRegistration.register(
bc, _httpService, "/middleware",
new ProvisioningController(_db,provisioners),
new UserEnrollmentController(_db,provisioners)
);
}
}
--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On 15 Jun 2017, at 11:36, Umesh Rajani <rajan...@gmail.com> wrote:Ohh, Neil, it's my mistake, actually zimbra service is like this:@Reference(policy=ReferencePolicy.DYNAMIC)private volatile IZimbra zimbra;
If I provide invalid configuration for zimbra then it tries to activate zimbra component three times, so it takes too much times.
On 15 Jun 2017, at 11:36, Umesh Rajani <rajan...@gmail.com> wrote:Ohh, Neil, it's my mistake, actually zimbra service is like this:@Reference(policy=ReferencePolicy.DYNAMIC)private volatile IZimbra zimbra;In this case the reference is mandatory but can be changed dynamically after startup. Mandatory means mandatory, there is no timeout: if an IZimbra service never appears then your component will never activate.
If I provide invalid configuration for zimbra then it tries to activate zimbra component three times, so it takes too much times.Forgive me for stating the obvious, but how about providing valid configuration for zimbra?
On Jun 15, 2017, at 4:45 AM, Umesh Rajani <rajan...@gmail.com> wrote:
On Thursday, June 15, 2017 at 4:21:20 PM UTC+5:30, Neil Bartlett wrote:On 15 Jun 2017, at 11:36, Umesh Rajani <rajan...@gmail.com> wrote:Ohh, Neil, it's my mistake, actually zimbra service is like this:@Reference(policy=ReferencePolicy.DYNAMIC)private volatile IZimbra zimbra;In this case the reference is mandatory but can be changed dynamically after startup. Mandatory means mandatory, there is no timeout: if an IZimbra service never appears then your component will never activate.Yes, that is true. but in case of invalid configuration it tries three time then it will go ahead.
If I provide invalid configuration for zimbra then it tries to activate zimbra component three times, so it takes too much times.Forgive me for stating the obvious, but how about providing valid configuration for zimbra?Actually, we are configuring IZimbra and other services very frequently and that configuration are provided by REST API, so if initial configuration is invalid then I can reconfigure it by API immediately.