Hi!

"Schaefer, Andreas" wrote:
> *NOTE! IMPORTANT!*
> * Do NOT apply new attribute values in set methods if the service uses a
> delegated model (i.e. it wraps the real service). Simply store the
> values in MBean attributes, and apply them in startService(). This is
> because the delegated service should be initialized in initService() and
> set methods may be called prior to that has been done.
> These two rules will ensure that services behave well.
> 
> Andy: You mean as long as the delegated service is not initialized otherwise
> you only can set attributes before initService().

Yes, but even if it is initialized I would recommend setting them in
initService(), or startService(). Why? Because set methods should never
throw exceptions, so if any change in attributes have any potential at
all of giving an exception you should apply it in init or start, because
they are specifically designed to throw exceptions if something goes
wrong. You can think of startService as "apply settings and start". So,
if you follow the above users will be able to change settings first in
their own pace (through some GUI for example) and when they feel they
have a good configuration they do "stop" and "start" to apply them. This
is much safer than to apply the settings directly in the set methods.

regards,
  Rickard

-- 
Rickard �berg

Email: [EMAIL PROTECTED]

Reply via email to