You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by vinshar <vi...@gmail.com> on 2016/01/23 22:27:55 UTC

cache.getCacheManager() returns null.

Hi,

Below code prints null. is this expected? is there any way to get Ignite
instance from a cache instance?


ignite = Ignition.start("cache-server-test-node.xml");
		System.out.println("#################################################
"+ignite.cache("TEST_REPLICATED").getCacheManager());

below is cache configuration

<bean class="org.apache.ignite.configuration.CacheConfiguration">
					<property name="name" value="TEST_REPLICATED" />
					<property name="cacheMode" value="REPLICATED" />
					<property name="managementEnabled" value="true" />
					<property name="statisticsEnabled" value="true" />
					<property name="evictionPolicy">
						<bean
class="org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy">
							<property name="maxSize" value="20000" />
						</bean>
					</property>
					<property name="startSize" value="21000" />
				</bean>


Regards,
Vinay
		



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/cache-getCacheManager-returns-null-tp2676.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: cache.getCacheManager() returns null.

Posted by Denis Magda <dm...@gridgain.com>.
I couldn't find any useful example on this.

However, you can refer to this test that showcases how it works in practice
https://github.com/apache/ignite/blob/b3d347e35a254928fd1c4a0473f1b17d642c72f3/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachingProviderSelfTest.java

--
Denis



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/cache-getCacheManager-returns-null-tp2676p2691.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: cache.getCacheManager() returns null.

Posted by vinshar <vi...@gmail.com>.
Is there any documentation or example to use jcache with ignite as
implementation?
On Jan 24, 2016 6:46 PM, "vkulichenko [via Apache Ignite Users]" <
ml-node+s70518n2682h98@n6.nabble.com> wrote:

> Hi Vinay,
>
> getCacheManager() will return the instance of JCache manager [1] if you
> used one to create a cache. If you created it using Ignite API, it will be
> null.
>
> To get an Ignite instance from IgniteCache do this: 'Ignite ignite =
> cache.unwrap(Ignite.class)'
>
> [1]
> https://ignite.apache.org/releases/1.5.0.final/javadoc/org/apache/ignite/cache/CacheManager.html
>
> -Val
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-ignite-users.70518.x6.nabble.com/cache-getCacheManager-returns-null-tp2676p2682.html
> To unsubscribe from cache.getCacheManager() returns null., click here
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2676&code=dmluc2hhcm1hLnRlY2hAZ21haWwuY29tfDI2NzZ8ODIyNDgwNzMy>
> .
> NAML
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/cache-getCacheManager-returns-null-tp2676p2683.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: cache.getCacheManager() returns null.

Posted by vkulichenko <va...@gmail.com>.
Hi Vinay,

getCacheManager() will return the instance of JCache manager [1] if you used
one to create a cache. If you created it using Ignite API, it will be null.

To get an Ignite instance from IgniteCache do this: 'Ignite ignite =
cache.unwrap(Ignite.class)'

[1]
https://ignite.apache.org/releases/1.5.0.final/javadoc/org/apache/ignite/cache/CacheManager.html

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/cache-getCacheManager-returns-null-tp2676p2682.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.