Re: [Architecture] How to forcefully remove an entry from app factory registry path cache?

2014-12-02 Thread Manjula Rathnayake
Hi Shazni and Pirinthapan,

thanks for the clarification.

On Tue, Dec 2, 2014 at 1:28 PM, Shazni Nazeer sha...@wso2.com wrote:

 Hi Manjula,

 Yes. The cacheId that you specify is not the the '*connectionId*' that we
 create in the method. When a resource is added to the cache we take the '
 *connectionId*' the way it is implemented to create the cache key.
 Therefore while retrieving the cache we should use the same way.

 Shazni Nazeer

 Senior Software Engineer

 Mob : +94 37331
 LinkedIn : http://lk.linkedin.com/in/shazninazeer
 Blog : http://shazninazeer.blogspot.com

 On Tue, Dec 2, 2014 at 12:20 PM, Pirinthapan Mahendran 
 pirintha...@wso2.com wrote:

 Hi Manjula,

 As my understanding cacheKey is a RegistryCacheKey object, which is
 different from the cacheId. So we don't need to read the cacheId.

 Thanks.



 Mahendran Pirinthapan
 Software Engineer | WSO2 Inc.
 Mobile +94772378732.

 On Tue, Dec 2, 2014 at 12:01 PM, Manjula Rathnayake manju...@wso2.com
 wrote:

 Hi Shazni,

 I checked the code for removeCache method and found that cacheKey is
 calculated as below.

 *String connectionId = (dataBaseConfiguration.getUserName() != null?
 dataBaseConfiguration.getUserName().split(@)[0]:dataBaseConfiguration.getUserName())
 + @ + dataBaseConfiguration.getDbUrl(); cacheKey =
 RegistryUtils.buildRegistryCacheKey(connectionId, tenantId, path);*

 But in registry.xml we have below element too,
 *cacheIdroot@jdbc:mysql://mysql1.appfactory.private.wso2.com:3306/dbGovernanceCloud
 http://mysql1.appfactory.private.wso2.com:3306/dbGovernanceCloud/cacheId*

 Shouldn't we read the cacheId element first and calculate as above if
 cacheId element is not defined?  Or did I misunderstand the configuration?

 thank you.

 On Wed, Nov 12, 2014 at 2:23 PM, Shazni Nazeer sha...@wso2.com wrote:

 Hi,

 Given that we know the registry path of the resource of which cache to
 be deleted and have an instance of the registry we can manually delete the
 cache with a method like removeCache in the below file. However, it's not a
 clean or correct way of manipulating the registry cache.


 https://github.com/wso2-dev/carbon-governance/blob/master/components/governance/org.wso2.carbon.governance.custom.lifecycles.checklist/src/main/java/org/wso2/carbon/governance/custom/lifecycles/checklist/util/LifecycleBeanPopulator.java

 Shazni Nazeer

 Senior Software Engineer

 Mob : +94 37331
 LinkedIn : http://lk.linkedin.com/in/shazninazeer
 Blog : http://shazninazeer.blogspot.com

 On Wed, Nov 12, 2014 at 1:48 PM, Dimuthu Leelarathne dimut...@wso2.com
  wrote:

 Hi Pulasthi,

 So when we are doing global invalidation, what is the method we are
 going to use to invalidate the cache within the JVM? :) Or are you going 
 to
 do it by magic?

 thanks,
 dimuthu

 On Wed, Nov 12, 2014 at 1:36 PM, Pulasthi Supun pulas...@wso2.com
 wrote:

 Hi Dimuthu,



 On Tue, Nov 11, 2014 at 4:17 PM, Dimuthu Leelarathne 
 dimut...@wso2.com wrote:

 Hi,



 On Tue, Nov 11, 2014 at 3:43 PM, Pulasthi Supun pulas...@wso2.com
 wrote:

 Hi Dimuthu,

 On Tue, Nov 11, 2014 at 2:05 PM, Dimuthu Leelarathne 
 dimut...@wso2.com wrote:

 Hi Pulasthi,

 Yes. We do not need  global invalidation (although it would solve
 the problem), but the request is to sink AF Registry cache with the 
 DB. We
 are in the same JVM, and we need a method/way to tell registry remove 
 this
 particular path from Registry path cache.


 Such a method would need to be accessed through something like the
 remote registry right?. The Registry api does not provide such a 
 method to
 remove entries from the Registry cache.


 It should not be remote. An OSGi level method would be fine. Is
 there a way to patch the registry that we use?


 I talked with Azeez regarding this. He also agrees that providing
 such a method to manipulate the cache is wrong. We need to think of some
 other solution for this. I am not sure if the global cache invalidation 
 has
 completed or can be backported into 4.2.0.
 @Amal is the work on that complete ?

 Regards,
 Pulasthi


 thanks,
 dimuthu



 Regards,
 Pulasthi


 thanks,
 dimuthu


 On Tue, Nov 11, 2014 at 12:16 PM, Pulasthi Supun 
 pulas...@wso2.com wrote:

 Hi All,


 From what i understand the AF and SM are in different domains
 that is why distributed caching will not be able to handle this 
 scenario
 right?. global cluster cache invalidation has been done with the use 
 of a
 pub sub mechanism ( discussed in archi under Global cluster cache
 invalidation code review Notes ) but this will only be available in 
 the
 next release AFAIK.

 Regards,
 Pulasthi

 On Tue, Nov 11, 2014 at 10:00 AM, Amalka Subasinghe 
 ama...@wso2.com wrote:


 Hi,

 The scenario is, we have mounted SM's registry to the App
 Factory registry to remove the remote call for read the resources. 
 but
 still the write calls happens via SM. see the image below.


 ​

 The problem is, once we do a write call to the SM's registry,
 App Factory registry cache won't get 

Re: [Architecture] How to forcefully remove an entry from app factory registry path cache?

2014-12-01 Thread Manjula Rathnayake
Hi Shazni,

I checked the code for removeCache method and found that cacheKey is
calculated as below.

*String connectionId = (dataBaseConfiguration.getUserName() != null?
dataBaseConfiguration.getUserName().split(@)[0]:dataBaseConfiguration.getUserName())
+ @ + dataBaseConfiguration.getDbUrl(); cacheKey =
RegistryUtils.buildRegistryCacheKey(connectionId, tenantId, path);*

But in registry.xml we have below element too,
*cacheIdroot@jdbc:mysql://mysql1.appfactory.private.wso2.com:3306/dbGovernanceCloud
http://mysql1.appfactory.private.wso2.com:3306/dbGovernanceCloud/cacheId*

Shouldn't we read the cacheId element first and calculate as above if
cacheId element is not defined?  Or did I misunderstand the configuration?

thank you.

On Wed, Nov 12, 2014 at 2:23 PM, Shazni Nazeer sha...@wso2.com wrote:

 Hi,

 Given that we know the registry path of the resource of which cache to be
 deleted and have an instance of the registry we can manually delete the
 cache with a method like removeCache in the below file. However, it's not a
 clean or correct way of manipulating the registry cache.


 https://github.com/wso2-dev/carbon-governance/blob/master/components/governance/org.wso2.carbon.governance.custom.lifecycles.checklist/src/main/java/org/wso2/carbon/governance/custom/lifecycles/checklist/util/LifecycleBeanPopulator.java

 Shazni Nazeer

 Senior Software Engineer

 Mob : +94 37331
 LinkedIn : http://lk.linkedin.com/in/shazninazeer
 Blog : http://shazninazeer.blogspot.com

 On Wed, Nov 12, 2014 at 1:48 PM, Dimuthu Leelarathne dimut...@wso2.com
 wrote:

 Hi Pulasthi,

 So when we are doing global invalidation, what is the method we are going
 to use to invalidate the cache within the JVM? :) Or are you going to do it
 by magic?

 thanks,
 dimuthu

 On Wed, Nov 12, 2014 at 1:36 PM, Pulasthi Supun pulas...@wso2.com
 wrote:

 Hi Dimuthu,



 On Tue, Nov 11, 2014 at 4:17 PM, Dimuthu Leelarathne dimut...@wso2.com
 wrote:

 Hi,



 On Tue, Nov 11, 2014 at 3:43 PM, Pulasthi Supun pulas...@wso2.com
 wrote:

 Hi Dimuthu,

 On Tue, Nov 11, 2014 at 2:05 PM, Dimuthu Leelarathne 
 dimut...@wso2.com wrote:

 Hi Pulasthi,

 Yes. We do not need  global invalidation (although it would solve the
 problem), but the request is to sink AF Registry cache with the DB. We 
 are
 in the same JVM, and we need a method/way to tell registry remove this
 particular path from Registry path cache.


 Such a method would need to be accessed through something like the
 remote registry right?. The Registry api does not provide such a method to
 remove entries from the Registry cache.


 It should not be remote. An OSGi level method would be fine. Is there a
 way to patch the registry that we use?


 I talked with Azeez regarding this. He also agrees that providing such a
 method to manipulate the cache is wrong. We need to think of some other
 solution for this. I am not sure if the global cache invalidation has
 completed or can be backported into 4.2.0.
 @Amal is the work on that complete ?

 Regards,
 Pulasthi


 thanks,
 dimuthu



 Regards,
 Pulasthi


 thanks,
 dimuthu


 On Tue, Nov 11, 2014 at 12:16 PM, Pulasthi Supun pulas...@wso2.com
 wrote:

 Hi All,


 From what i understand the AF and SM are in different domains that
 is why distributed caching will not be able to handle this scenario 
 right?.
 global cluster cache invalidation has been done with the use of a pub 
 sub
 mechanism ( discussed in archi under Global cluster cache invalidation
 code review Notes ) but this will only be available in the next release
 AFAIK.

 Regards,
 Pulasthi

 On Tue, Nov 11, 2014 at 10:00 AM, Amalka Subasinghe ama...@wso2.com
  wrote:


 Hi,

 The scenario is, we have mounted SM's registry to the App Factory
 registry to remove the remote call for read the resources. but still 
 the
 write calls happens via SM. see the image below.


 ​

 The problem is, once we do a write call to the SM's registry, App
 Factory registry cache won't get updated, so old information will be 
 shown
 in App Factory pages.
 Is there a way to remove an entry from the App Factory registry
 cache when we do a write call to the SM's registry? then when we do a 
 read
 call, it will load the cache again and show the updated information.

 Thanks
 Amalka


 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --
 --
 Pulasthi Supun
 Software Engineer; WSO2 Inc.; http://wso2.com,
 Email: pulas...@wso2.com
 Mobile: +94 (71) 9258281
 Blog : http://pulasthisupun.blogspot.com/
 Git hub profile: https://github.com/pulasthi




 --
 Dimuthu Leelarathne
 Architect  Product Lead of App Factory

 WSO2, Inc. (http://wso2.com)
 email: dimut...@wso2.com
 Mobile : 0773661935

 Lean . Enterprise . Middleware




 --
 --
 Pulasthi Supun
 Software Engineer; WSO2 Inc.; http://wso2.com,
 Email: pulas...@wso2.com
 Mobile: +94 (71) 9258281
 Blog : 

Re: [Architecture] How to forcefully remove an entry from app factory registry path cache?

2014-12-01 Thread Pirinthapan Mahendran
Hi Manjula,

As my understanding cacheKey is a RegistryCacheKey object, which is
different from the cacheId. So we don't need to read the cacheId.

Thanks.



Mahendran Pirinthapan
Software Engineer | WSO2 Inc.
Mobile +94772378732.

On Tue, Dec 2, 2014 at 12:01 PM, Manjula Rathnayake manju...@wso2.com
wrote:

 Hi Shazni,

 I checked the code for removeCache method and found that cacheKey is
 calculated as below.

 *String connectionId = (dataBaseConfiguration.getUserName() != null?
 dataBaseConfiguration.getUserName().split(@)[0]:dataBaseConfiguration.getUserName())
 + @ + dataBaseConfiguration.getDbUrl(); cacheKey =
 RegistryUtils.buildRegistryCacheKey(connectionId, tenantId, path);*

 But in registry.xml we have below element too,
 *cacheIdroot@jdbc:mysql://mysql1.appfactory.private.wso2.com:3306/dbGovernanceCloud
 http://mysql1.appfactory.private.wso2.com:3306/dbGovernanceCloud/cacheId*

 Shouldn't we read the cacheId element first and calculate as above if
 cacheId element is not defined?  Or did I misunderstand the configuration?

 thank you.

 On Wed, Nov 12, 2014 at 2:23 PM, Shazni Nazeer sha...@wso2.com wrote:

 Hi,

 Given that we know the registry path of the resource of which cache to be
 deleted and have an instance of the registry we can manually delete the
 cache with a method like removeCache in the below file. However, it's not a
 clean or correct way of manipulating the registry cache.


 https://github.com/wso2-dev/carbon-governance/blob/master/components/governance/org.wso2.carbon.governance.custom.lifecycles.checklist/src/main/java/org/wso2/carbon/governance/custom/lifecycles/checklist/util/LifecycleBeanPopulator.java

 Shazni Nazeer

 Senior Software Engineer

 Mob : +94 37331
 LinkedIn : http://lk.linkedin.com/in/shazninazeer
 Blog : http://shazninazeer.blogspot.com

 On Wed, Nov 12, 2014 at 1:48 PM, Dimuthu Leelarathne dimut...@wso2.com
 wrote:

 Hi Pulasthi,

 So when we are doing global invalidation, what is the method we are
 going to use to invalidate the cache within the JVM? :) Or are you going to
 do it by magic?

 thanks,
 dimuthu

 On Wed, Nov 12, 2014 at 1:36 PM, Pulasthi Supun pulas...@wso2.com
 wrote:

 Hi Dimuthu,



 On Tue, Nov 11, 2014 at 4:17 PM, Dimuthu Leelarathne dimut...@wso2.com
  wrote:

 Hi,



 On Tue, Nov 11, 2014 at 3:43 PM, Pulasthi Supun pulas...@wso2.com
 wrote:

 Hi Dimuthu,

 On Tue, Nov 11, 2014 at 2:05 PM, Dimuthu Leelarathne 
 dimut...@wso2.com wrote:

 Hi Pulasthi,

 Yes. We do not need  global invalidation (although it would solve
 the problem), but the request is to sink AF Registry cache with the DB. 
 We
 are in the same JVM, and we need a method/way to tell registry remove 
 this
 particular path from Registry path cache.


 Such a method would need to be accessed through something like the
 remote registry right?. The Registry api does not provide such a method 
 to
 remove entries from the Registry cache.


 It should not be remote. An OSGi level method would be fine. Is there
 a way to patch the registry that we use?


 I talked with Azeez regarding this. He also agrees that providing such
 a method to manipulate the cache is wrong. We need to think of some other
 solution for this. I am not sure if the global cache invalidation has
 completed or can be backported into 4.2.0.
 @Amal is the work on that complete ?

 Regards,
 Pulasthi


 thanks,
 dimuthu



 Regards,
 Pulasthi


 thanks,
 dimuthu


 On Tue, Nov 11, 2014 at 12:16 PM, Pulasthi Supun pulas...@wso2.com
 wrote:

 Hi All,


 From what i understand the AF and SM are in different domains that
 is why distributed caching will not be able to handle this scenario 
 right?.
 global cluster cache invalidation has been done with the use of a pub 
 sub
 mechanism ( discussed in archi under Global cluster cache invalidation
 code review Notes ) but this will only be available in the next 
 release
 AFAIK.

 Regards,
 Pulasthi

 On Tue, Nov 11, 2014 at 10:00 AM, Amalka Subasinghe 
 ama...@wso2.com wrote:


 Hi,

 The scenario is, we have mounted SM's registry to the App Factory
 registry to remove the remote call for read the resources. but still 
 the
 write calls happens via SM. see the image below.


 ​

 The problem is, once we do a write call to the SM's registry, App
 Factory registry cache won't get updated, so old information will be 
 shown
 in App Factory pages.
 Is there a way to remove an entry from the App Factory registry
 cache when we do a write call to the SM's registry? then when we do a 
 read
 call, it will load the cache again and show the updated information.

 Thanks
 Amalka


 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --
 --
 Pulasthi Supun
 Software Engineer; WSO2 Inc.; http://wso2.com,
 Email: pulas...@wso2.com
 Mobile: +94 (71) 9258281
 Blog : http://pulasthisupun.blogspot.com/
 Git hub profile: https://github.com/pulasthi




 --
 Dimuthu 

Re: [Architecture] How to forcefully remove an entry from app factory registry path cache?

2014-12-01 Thread Shazni Nazeer
Hi Manjula,

Yes. The cacheId that you specify is not the the '*connectionId*' that we
create in the method. When a resource is added to the cache we take the '
*connectionId*' the way it is implemented to create the cache key.
Therefore while retrieving the cache we should use the same way.

Shazni Nazeer

Senior Software Engineer

Mob : +94 37331
LinkedIn : http://lk.linkedin.com/in/shazninazeer
Blog : http://shazninazeer.blogspot.com

On Tue, Dec 2, 2014 at 12:20 PM, Pirinthapan Mahendran pirintha...@wso2.com
 wrote:

 Hi Manjula,

 As my understanding cacheKey is a RegistryCacheKey object, which is
 different from the cacheId. So we don't need to read the cacheId.

 Thanks.



 Mahendran Pirinthapan
 Software Engineer | WSO2 Inc.
 Mobile +94772378732.

 On Tue, Dec 2, 2014 at 12:01 PM, Manjula Rathnayake manju...@wso2.com
 wrote:

 Hi Shazni,

 I checked the code for removeCache method and found that cacheKey is
 calculated as below.

 *String connectionId = (dataBaseConfiguration.getUserName() != null?
 dataBaseConfiguration.getUserName().split(@)[0]:dataBaseConfiguration.getUserName())
 + @ + dataBaseConfiguration.getDbUrl(); cacheKey =
 RegistryUtils.buildRegistryCacheKey(connectionId, tenantId, path);*

 But in registry.xml we have below element too,
 *cacheIdroot@jdbc:mysql://mysql1.appfactory.private.wso2.com:3306/dbGovernanceCloud
 http://mysql1.appfactory.private.wso2.com:3306/dbGovernanceCloud/cacheId*

 Shouldn't we read the cacheId element first and calculate as above if
 cacheId element is not defined?  Or did I misunderstand the configuration?

 thank you.

 On Wed, Nov 12, 2014 at 2:23 PM, Shazni Nazeer sha...@wso2.com wrote:

 Hi,

 Given that we know the registry path of the resource of which cache to
 be deleted and have an instance of the registry we can manually delete the
 cache with a method like removeCache in the below file. However, it's not a
 clean or correct way of manipulating the registry cache.


 https://github.com/wso2-dev/carbon-governance/blob/master/components/governance/org.wso2.carbon.governance.custom.lifecycles.checklist/src/main/java/org/wso2/carbon/governance/custom/lifecycles/checklist/util/LifecycleBeanPopulator.java

 Shazni Nazeer

 Senior Software Engineer

 Mob : +94 37331
 LinkedIn : http://lk.linkedin.com/in/shazninazeer
 Blog : http://shazninazeer.blogspot.com

 On Wed, Nov 12, 2014 at 1:48 PM, Dimuthu Leelarathne dimut...@wso2.com
 wrote:

 Hi Pulasthi,

 So when we are doing global invalidation, what is the method we are
 going to use to invalidate the cache within the JVM? :) Or are you going to
 do it by magic?

 thanks,
 dimuthu

 On Wed, Nov 12, 2014 at 1:36 PM, Pulasthi Supun pulas...@wso2.com
 wrote:

 Hi Dimuthu,



 On Tue, Nov 11, 2014 at 4:17 PM, Dimuthu Leelarathne 
 dimut...@wso2.com wrote:

 Hi,



 On Tue, Nov 11, 2014 at 3:43 PM, Pulasthi Supun pulas...@wso2.com
 wrote:

 Hi Dimuthu,

 On Tue, Nov 11, 2014 at 2:05 PM, Dimuthu Leelarathne 
 dimut...@wso2.com wrote:

 Hi Pulasthi,

 Yes. We do not need  global invalidation (although it would solve
 the problem), but the request is to sink AF Registry cache with the 
 DB. We
 are in the same JVM, and we need a method/way to tell registry remove 
 this
 particular path from Registry path cache.


 Such a method would need to be accessed through something like the
 remote registry right?. The Registry api does not provide such a method 
 to
 remove entries from the Registry cache.


 It should not be remote. An OSGi level method would be fine. Is there
 a way to patch the registry that we use?


 I talked with Azeez regarding this. He also agrees that providing such
 a method to manipulate the cache is wrong. We need to think of some other
 solution for this. I am not sure if the global cache invalidation has
 completed or can be backported into 4.2.0.
 @Amal is the work on that complete ?

 Regards,
 Pulasthi


 thanks,
 dimuthu



 Regards,
 Pulasthi


 thanks,
 dimuthu


 On Tue, Nov 11, 2014 at 12:16 PM, Pulasthi Supun pulas...@wso2.com
  wrote:

 Hi All,


 From what i understand the AF and SM are in different domains that
 is why distributed caching will not be able to handle this scenario 
 right?.
 global cluster cache invalidation has been done with the use of a pub 
 sub
 mechanism ( discussed in archi under Global cluster cache 
 invalidation
 code review Notes ) but this will only be available in the next 
 release
 AFAIK.

 Regards,
 Pulasthi

 On Tue, Nov 11, 2014 at 10:00 AM, Amalka Subasinghe 
 ama...@wso2.com wrote:


 Hi,

 The scenario is, we have mounted SM's registry to the App Factory
 registry to remove the remote call for read the resources. but still 
 the
 write calls happens via SM. see the image below.


 ​

 The problem is, once we do a write call to the SM's registry, App
 Factory registry cache won't get updated, so old information will be 
 shown
 in App Factory pages.
 Is there a way to remove an entry from the App Factory registry
 cache when we do 

Re: [Architecture] How to forcefully remove an entry from app factory registry path cache?

2014-11-18 Thread Pirinthapan Mahendran
Hi all,

Since we don't have any other ways to overcome this issue, I'm going with
the solution by implementing a method to remove the registry cache as
Shazni mentioned in the link. So before we doing a write call to the SM
registry we will call this method to clear the cache for the particular
path from AF registry.

Thanks.



Mahendran Pirinthapan
Software Engineer | WSO2 Inc.
Mobile +94772378732.

On Wed, Nov 12, 2014 at 3:26 PM, Amal Gunatilake am...@wso2.com wrote:

 Hi,

 The global cache invalidation implementation is complete long time ago and
 the documentation can be found at [1]. This has been tested in registry and
 it's working well. However this is implemented to support from carbon 4.3.0
 onwards.

 [1]
 https://docs.google.com/a/wso2.com/document/d/1yWE-3FfWaM2hKS6kqtb8uDR8o9szBH9qQjkPZqWJmPc

 Thank you,
 Amal.


 Thank you   Best regards,

 *Amal Gunatilake*
  Software Engineer
 WSO2 Inc.; http://wso2.com
 lean.enterprise.middleware

 On Wed, Nov 12, 2014 at 2:23 PM, Shazni Nazeer sha...@wso2.com wrote:

 Hi,

 Given that we know the registry path of the resource of which cache to be
 deleted and have an instance of the registry we can manually delete the
 cache with a method like removeCache in the below file. However, it's not a
 clean or correct way of manipulating the registry cache.


 https://github.com/wso2-dev/carbon-governance/blob/master/components/governance/org.wso2.carbon.governance.custom.lifecycles.checklist/src/main/java/org/wso2/carbon/governance/custom/lifecycles/checklist/util/LifecycleBeanPopulator.java

 Shazni Nazeer

 Senior Software Engineer

 Mob : +94 37331
 LinkedIn : http://lk.linkedin.com/in/shazninazeer
 Blog : http://shazninazeer.blogspot.com

 On Wed, Nov 12, 2014 at 1:48 PM, Dimuthu Leelarathne dimut...@wso2.com
 wrote:

 Hi Pulasthi,

 So when we are doing global invalidation, what is the method we are
 going to use to invalidate the cache within the JVM? :) Or are you going to
 do it by magic?

 thanks,
 dimuthu

 On Wed, Nov 12, 2014 at 1:36 PM, Pulasthi Supun pulas...@wso2.com
 wrote:

 Hi Dimuthu,



 On Tue, Nov 11, 2014 at 4:17 PM, Dimuthu Leelarathne dimut...@wso2.com
  wrote:

 Hi,



 On Tue, Nov 11, 2014 at 3:43 PM, Pulasthi Supun pulas...@wso2.com
 wrote:

 Hi Dimuthu,

 On Tue, Nov 11, 2014 at 2:05 PM, Dimuthu Leelarathne 
 dimut...@wso2.com wrote:

 Hi Pulasthi,

 Yes. We do not need  global invalidation (although it would solve
 the problem), but the request is to sink AF Registry cache with the DB. 
 We
 are in the same JVM, and we need a method/way to tell registry remove 
 this
 particular path from Registry path cache.


 Such a method would need to be accessed through something like the
 remote registry right?. The Registry api does not provide such a method 
 to
 remove entries from the Registry cache.


 It should not be remote. An OSGi level method would be fine. Is there
 a way to patch the registry that we use?


 I talked with Azeez regarding this. He also agrees that providing such
 a method to manipulate the cache is wrong. We need to think of some other
 solution for this. I am not sure if the global cache invalidation has
 completed or can be backported into 4.2.0.
 @Amal is the work on that complete ?

 Regards,
 Pulasthi


 thanks,
 dimuthu



 Regards,
 Pulasthi


 thanks,
 dimuthu


 On Tue, Nov 11, 2014 at 12:16 PM, Pulasthi Supun pulas...@wso2.com
 wrote:

 Hi All,


 From what i understand the AF and SM are in different domains that
 is why distributed caching will not be able to handle this scenario 
 right?.
 global cluster cache invalidation has been done with the use of a pub 
 sub
 mechanism ( discussed in archi under Global cluster cache invalidation
 code review Notes ) but this will only be available in the next 
 release
 AFAIK.

 Regards,
 Pulasthi

 On Tue, Nov 11, 2014 at 10:00 AM, Amalka Subasinghe 
 ama...@wso2.com wrote:


 Hi,

 The scenario is, we have mounted SM's registry to the App Factory
 registry to remove the remote call for read the resources. but still 
 the
 write calls happens via SM. see the image below.


 ​

 The problem is, once we do a write call to the SM's registry, App
 Factory registry cache won't get updated, so old information will be 
 shown
 in App Factory pages.
 Is there a way to remove an entry from the App Factory registry
 cache when we do a write call to the SM's registry? then when we do a 
 read
 call, it will load the cache again and show the updated information.

 Thanks
 Amalka


 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --
 --
 Pulasthi Supun
 Software Engineer; WSO2 Inc.; http://wso2.com,
 Email: pulas...@wso2.com
 Mobile: +94 (71) 9258281
 Blog : http://pulasthisupun.blogspot.com/
 Git hub profile: https://github.com/pulasthi




 --
 Dimuthu Leelarathne
 Architect  Product Lead of App Factory

 WSO2, Inc. (http://wso2.com)
 email: 

Re: [Architecture] How to forcefully remove an entry from app factory registry path cache?

2014-11-12 Thread Shazni Nazeer
Hi,

Given that we know the registry path of the resource of which cache to be
deleted and have an instance of the registry we can manually delete the
cache with a method like removeCache in the below file. However, it's not a
clean or correct way of manipulating the registry cache.

https://github.com/wso2-dev/carbon-governance/blob/master/components/governance/org.wso2.carbon.governance.custom.lifecycles.checklist/src/main/java/org/wso2/carbon/governance/custom/lifecycles/checklist/util/LifecycleBeanPopulator.java

Shazni Nazeer

Senior Software Engineer

Mob : +94 37331
LinkedIn : http://lk.linkedin.com/in/shazninazeer
Blog : http://shazninazeer.blogspot.com

On Wed, Nov 12, 2014 at 1:48 PM, Dimuthu Leelarathne dimut...@wso2.com
wrote:

 Hi Pulasthi,

 So when we are doing global invalidation, what is the method we are going
 to use to invalidate the cache within the JVM? :) Or are you going to do it
 by magic?

 thanks,
 dimuthu

 On Wed, Nov 12, 2014 at 1:36 PM, Pulasthi Supun pulas...@wso2.com wrote:

 Hi Dimuthu,



 On Tue, Nov 11, 2014 at 4:17 PM, Dimuthu Leelarathne dimut...@wso2.com
 wrote:

 Hi,



 On Tue, Nov 11, 2014 at 3:43 PM, Pulasthi Supun pulas...@wso2.com
 wrote:

 Hi Dimuthu,

 On Tue, Nov 11, 2014 at 2:05 PM, Dimuthu Leelarathne dimut...@wso2.com
  wrote:

 Hi Pulasthi,

 Yes. We do not need  global invalidation (although it would solve the
 problem), but the request is to sink AF Registry cache with the DB. We are
 in the same JVM, and we need a method/way to tell registry remove this
 particular path from Registry path cache.


 Such a method would need to be accessed through something like the
 remote registry right?. The Registry api does not provide such a method to
 remove entries from the Registry cache.


 It should not be remote. An OSGi level method would be fine. Is there a
 way to patch the registry that we use?


 I talked with Azeez regarding this. He also agrees that providing such a
 method to manipulate the cache is wrong. We need to think of some other
 solution for this. I am not sure if the global cache invalidation has
 completed or can be backported into 4.2.0.
 @Amal is the work on that complete ?

 Regards,
 Pulasthi


 thanks,
 dimuthu



 Regards,
 Pulasthi


 thanks,
 dimuthu


 On Tue, Nov 11, 2014 at 12:16 PM, Pulasthi Supun pulas...@wso2.com
 wrote:

 Hi All,


 From what i understand the AF and SM are in different domains that is
 why distributed caching will not be able to handle this scenario right?.
 global cluster cache invalidation has been done with the use of a pub sub
 mechanism ( discussed in archi under Global cluster cache invalidation
 code review Notes ) but this will only be available in the next release
 AFAIK.

 Regards,
 Pulasthi

 On Tue, Nov 11, 2014 at 10:00 AM, Amalka Subasinghe ama...@wso2.com
 wrote:


 Hi,

 The scenario is, we have mounted SM's registry to the App Factory
 registry to remove the remote call for read the resources. but still the
 write calls happens via SM. see the image below.


 ​

 The problem is, once we do a write call to the SM's registry, App
 Factory registry cache won't get updated, so old information will be 
 shown
 in App Factory pages.
 Is there a way to remove an entry from the App Factory registry
 cache when we do a write call to the SM's registry? then when we do a 
 read
 call, it will load the cache again and show the updated information.

 Thanks
 Amalka


 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --
 --
 Pulasthi Supun
 Software Engineer; WSO2 Inc.; http://wso2.com,
 Email: pulas...@wso2.com
 Mobile: +94 (71) 9258281
 Blog : http://pulasthisupun.blogspot.com/
 Git hub profile: https://github.com/pulasthi




 --
 Dimuthu Leelarathne
 Architect  Product Lead of App Factory

 WSO2, Inc. (http://wso2.com)
 email: dimut...@wso2.com
 Mobile : 0773661935

 Lean . Enterprise . Middleware




 --
 --
 Pulasthi Supun
 Software Engineer; WSO2 Inc.; http://wso2.com,
 Email: pulas...@wso2.com
 Mobile: +94 (71) 9258281
 Blog : http://pulasthisupun.blogspot.com/
 Git hub profile: https://github.com/pulasthi




 --
 Dimuthu Leelarathne
 Architect  Product Lead of App Factory

 WSO2, Inc. (http://wso2.com)
 email: dimut...@wso2.com
 Mobile : 0773661935

 Lean . Enterprise . Middleware




 --
 --
 Pulasthi Supun
 Software Engineer; WSO2 Inc.; http://wso2.com,
 Email: pulas...@wso2.com
 Mobile: +94 (71) 9258281
 Blog : http://pulasthisupun.blogspot.com/
 Git hub profile: https://github.com/pulasthi




 --
 Dimuthu Leelarathne
 Architect  Product Lead of App Factory

 WSO2, Inc. (http://wso2.com)
 email: dimut...@wso2.com
 Mobile : 0773661935

 Lean . Enterprise . Middleware

___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] How to forcefully remove an entry from app factory registry path cache?

2014-11-12 Thread Amal Gunatilake
Hi,

The global cache invalidation implementation is complete long time ago and
the documentation can be found at [1]. This has been tested in registry and
it's working well. However this is implemented to support from carbon 4.3.0
onwards.

[1]
https://docs.google.com/a/wso2.com/document/d/1yWE-3FfWaM2hKS6kqtb8uDR8o9szBH9qQjkPZqWJmPc

Thank you,
Amal.


Thank you   Best regards,

*Amal Gunatilake*
 Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

On Wed, Nov 12, 2014 at 2:23 PM, Shazni Nazeer sha...@wso2.com wrote:

 Hi,

 Given that we know the registry path of the resource of which cache to be
 deleted and have an instance of the registry we can manually delete the
 cache with a method like removeCache in the below file. However, it's not a
 clean or correct way of manipulating the registry cache.


 https://github.com/wso2-dev/carbon-governance/blob/master/components/governance/org.wso2.carbon.governance.custom.lifecycles.checklist/src/main/java/org/wso2/carbon/governance/custom/lifecycles/checklist/util/LifecycleBeanPopulator.java

 Shazni Nazeer

 Senior Software Engineer

 Mob : +94 37331
 LinkedIn : http://lk.linkedin.com/in/shazninazeer
 Blog : http://shazninazeer.blogspot.com

 On Wed, Nov 12, 2014 at 1:48 PM, Dimuthu Leelarathne dimut...@wso2.com
 wrote:

 Hi Pulasthi,

 So when we are doing global invalidation, what is the method we are going
 to use to invalidate the cache within the JVM? :) Or are you going to do it
 by magic?

 thanks,
 dimuthu

 On Wed, Nov 12, 2014 at 1:36 PM, Pulasthi Supun pulas...@wso2.com
 wrote:

 Hi Dimuthu,



 On Tue, Nov 11, 2014 at 4:17 PM, Dimuthu Leelarathne dimut...@wso2.com
 wrote:

 Hi,



 On Tue, Nov 11, 2014 at 3:43 PM, Pulasthi Supun pulas...@wso2.com
 wrote:

 Hi Dimuthu,

 On Tue, Nov 11, 2014 at 2:05 PM, Dimuthu Leelarathne 
 dimut...@wso2.com wrote:

 Hi Pulasthi,

 Yes. We do not need  global invalidation (although it would solve the
 problem), but the request is to sink AF Registry cache with the DB. We 
 are
 in the same JVM, and we need a method/way to tell registry remove this
 particular path from Registry path cache.


 Such a method would need to be accessed through something like the
 remote registry right?. The Registry api does not provide such a method to
 remove entries from the Registry cache.


 It should not be remote. An OSGi level method would be fine. Is there a
 way to patch the registry that we use?


 I talked with Azeez regarding this. He also agrees that providing such a
 method to manipulate the cache is wrong. We need to think of some other
 solution for this. I am not sure if the global cache invalidation has
 completed or can be backported into 4.2.0.
 @Amal is the work on that complete ?

 Regards,
 Pulasthi


 thanks,
 dimuthu



 Regards,
 Pulasthi


 thanks,
 dimuthu


 On Tue, Nov 11, 2014 at 12:16 PM, Pulasthi Supun pulas...@wso2.com
 wrote:

 Hi All,


 From what i understand the AF and SM are in different domains that
 is why distributed caching will not be able to handle this scenario 
 right?.
 global cluster cache invalidation has been done with the use of a pub 
 sub
 mechanism ( discussed in archi under Global cluster cache invalidation
 code review Notes ) but this will only be available in the next release
 AFAIK.

 Regards,
 Pulasthi

 On Tue, Nov 11, 2014 at 10:00 AM, Amalka Subasinghe ama...@wso2.com
  wrote:


 Hi,

 The scenario is, we have mounted SM's registry to the App Factory
 registry to remove the remote call for read the resources. but still 
 the
 write calls happens via SM. see the image below.


 ​

 The problem is, once we do a write call to the SM's registry, App
 Factory registry cache won't get updated, so old information will be 
 shown
 in App Factory pages.
 Is there a way to remove an entry from the App Factory registry
 cache when we do a write call to the SM's registry? then when we do a 
 read
 call, it will load the cache again and show the updated information.

 Thanks
 Amalka


 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --
 --
 Pulasthi Supun
 Software Engineer; WSO2 Inc.; http://wso2.com,
 Email: pulas...@wso2.com
 Mobile: +94 (71) 9258281
 Blog : http://pulasthisupun.blogspot.com/
 Git hub profile: https://github.com/pulasthi




 --
 Dimuthu Leelarathne
 Architect  Product Lead of App Factory

 WSO2, Inc. (http://wso2.com)
 email: dimut...@wso2.com
 Mobile : 0773661935

 Lean . Enterprise . Middleware




 --
 --
 Pulasthi Supun
 Software Engineer; WSO2 Inc.; http://wso2.com,
 Email: pulas...@wso2.com
 Mobile: +94 (71) 9258281
 Blog : http://pulasthisupun.blogspot.com/
 Git hub profile: https://github.com/pulasthi




 --
 Dimuthu Leelarathne
 Architect  Product Lead of App Factory

 WSO2, Inc. (http://wso2.com)
 email: dimut...@wso2.com
 Mobile : 0773661935

 Lean . Enterprise . Middleware




 --
 --
 Pulasthi Supun
 Software 

[Architecture] How to forcefully remove an entry from app factory registry path cache?

2014-11-10 Thread Amalka Subasinghe
Hi,

The scenario is, we have mounted SM's registry to the App Factory registry
to remove the remote call for read the resources. but still the write calls
happens via SM. see the image below.


​

The problem is, once we do a write call to the SM's registry, App Factory
registry cache won't get updated, so old information will be shown in App
Factory pages.
Is there a way to remove an entry from the App Factory registry cache when
we do a write call to the SM's registry? then when we do a read call, it
will load the cache again and show the updated information.

Thanks
Amalka
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] How to forcefully remove an entry from app factory registry path cache?

2014-11-10 Thread Pulasthi Supun
Hi All,


From what i understand the AF and SM are in different domains that is why
distributed caching will not be able to handle this scenario right?. global
cluster cache invalidation has been done with the use of a pub sub
mechanism ( discussed in archi under Global cluster cache invalidation
code review Notes ) but this will only be available in the next release
AFAIK.

Regards,
Pulasthi

On Tue, Nov 11, 2014 at 10:00 AM, Amalka Subasinghe ama...@wso2.com wrote:


 Hi,

 The scenario is, we have mounted SM's registry to the App Factory registry
 to remove the remote call for read the resources. but still the write calls
 happens via SM. see the image below.


 ​

 The problem is, once we do a write call to the SM's registry, App Factory
 registry cache won't get updated, so old information will be shown in App
 Factory pages.
 Is there a way to remove an entry from the App Factory registry cache when
 we do a write call to the SM's registry? then when we do a read call, it
 will load the cache again and show the updated information.

 Thanks
 Amalka


 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




-- 
--
Pulasthi Supun
Software Engineer; WSO2 Inc.; http://wso2.com,
Email: pulas...@wso2.com
Mobile: +94 (71) 9258281
Blog : http://pulasthisupun.blogspot.com/
Git hub profile: https://github.com/pulasthi
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture