Using serviceBinder.bind(Service, ServiceImpl).preventReloading() solves
the issue. Now I can use impl =
(ServiceImpl)ServiceProxyUtil.getImplementation(registry.getService(Service.class)).
So I dont need to invoke methods using reflection and I have AOP and
Decoration for the rest of the service methods as long as I use the proxy
to access the methods.

Mission successful.


2013/10/16 Martin Kersten <martin.kersten...@gmail.com>

> I checked the sources. After setting production mode to test my proxy util
> for this it does not change reload behaviour. It seams to be only switched
> off in case a service is bound with preventReload or a global property to
> prevent reloading is set or the service is not an interface.
>
> So in the end in production mode the reloading is enabled(?).
>
>
> 2013/10/16 Martin Kersten <martin.kersten...@gmail.com>
>
>> Dont see this to work with AOP on the LegacyInterface or do I overlook
>> something.
>>
>> Better might be the use of a legacy service and provide an extended
>> service using refelction to access the legacy service implementation
>> (subclass). Would also make it clear and nice.
>>
>>
>> 2013/10/16 Lance Java <lance.j...@googlemail.com>
>>
>>> Here's a workaround
>>>
>>> public interface LegacyService {
>>>                 void method1();
>>> }
>>>
>>> public class LegacyServiceImpl implements LegacyService {
>>>                 public void method1() { ... }
>>>                 public void method2() { ... }
>>> }
>>>
>>> public interface ExtendedService {
>>>                 void method2();
>>> }
>>>
>>> public interface Hack {
>>>                 public LegacyService getLegacyService();
>>>                 public ExtendedService getExtendedService();
>>> }
>>>
>>> AppModule
>>> ---------
>>> public Hack buildHack(@Autobuild LegacyServiceImpl impl) {
>>>                 return new Hack() {
>>>                                 public LegacyService getLegacyService() {
>>> return impl; }
>>>
>>>                                 public ExtendedService
>>> getExtendedService()
>>> {
>>>                                                 return new
>>> ExtendedService()
>>> {                                                               public
>>> void
>>> method2()
>>> {
>>> return impl.method2();
>>>                                                                 }
>>>                                                 };
>>>                                 };
>>>                 };
>>> }
>>>
>>> public LegacyService buildLegacyService(Hack hack) {
>>>                 return hack.getLegacyService();
>>> }
>>>
>>> public ExtendedService buildExtendedService(Hack hack) {
>>>                 return hack.getExtendedService();
>>> }
>>>
>>>
>>>
>>> Component
>>> ---------
>>> @Inject
>>> private LegacyService legacyService;
>>>
>>> @Inject
>>> private ExtendedService extendedService;
>>>
>>
>>
>

Reply via email to