<Insert Picture Here>
Coherence 12.1.2 Configuration Enhancements
Part 1: @Injectables
Brian Oliver
Senior Consulting Memb...
2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
The following is intended to outline our general pr...
The Agenda…
4 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Coherence 12.1.2 Configuration
Enhancements…
• The ...
The Objectives…
6 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
The Objectives
• Improve Integration with Third-Par...
7 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
What’s different?
• Nothing… and everything!
• Inte...
The Simple
Improvements…
9 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Old Style Cache Store Configuration
<cache-config
x...
10 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Old Style Cache Store Configuration
public class M...
11 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Old Style (with parameters)
. . .
<caching-schemes...
12 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Old Style (with parameters)
public class MyOldStyl...
Introducing @Injectable’s
14 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
New @Injectable Cache Store
public class Injectabl...
15 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
New @Injectable Cache Store
<cache-config
xmlns="h...
16 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Introducing @Injectables
• Applicable when Coheren...
17 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Introducing @Injectables
• Javadoc defines what ca...
18 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Introducing @Injectables
• Where does this apply?
...
Summary
20 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Summary
• Coherence 12.1.2 introduces @Injectable ...
21 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Next Part?
• Using Objects from other frameworks
–...
Join the Coherence Community
http://coherence.oracle.com
@OracleCoherence
/OracleCoherence
blogs.oracle.com/OracleCoherenc...
23 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
The proceeding is intended to outline our general ...
<Insert Picture Here>
Coherence 12.1.2 Configuration Enhancements
Part 1: @Injectables
Brian Oliver
Senior Consulting Memb...
Upcoming SlideShare
Loading in...5
×

Coherence Configuration Enhancements - Part 1 - Injectables

435

Published on

Watch on YouTube:
http://www.youtube.com/watch?v=muCC90UMSWY

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
435
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
15
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • We’ve made some significant investments in Coherence Cache Configuration for 12.1.2This presentation outlines some of the enhancements and flexibility of the new internal infrastructure for improving integration and extension of Coherence, especially by third-parties.
  • *Eventually complete programmatic configuration of Coherence
  • * Not all Xml dependencies have been removed in 12.1.2. Last remaining should be removed in 12.1.3* If an existing configuration doesn’t work, people can rollback to “old style” by configuring the Configurable Cache Factory to be the DefaultConfigurableCacheFactory. Old style will be removed in 12.1.4
  • @Injectable tells Coherence to inject a value/object from it’s local “context”. Ie: the “context” in which the instance/object/class is being used.
  • Now we no longer need to specify the {cache-name} parameter any more! Much simpler!
  • For &lt;class-scheme&gt;, &lt;instance&gt; and custom namespaces. Partition-related schemes not supported in 12.1.2 eg: partition-listener, but &lt;interceptors&gt; are.The ResourceRegistry is defined on the ConfigurableCacheFactory!
  • NOTES: If an resource can’t be found or injected, no error occurs (ie: it’s injectable but doesn’t force injection)Will attempt to coerce to the correct type. Will fail with an exception if it can’t
  • * For &lt;class-scheme&gt;, &lt;instance&gt; and custom namespaces. Partition-related schemes not supported in 12.1.2 eg: partition-listener, but &lt;interceptors&gt; are.
  • Come join this large, vibrant community.We have a pretty significant engagement through various social media channels like twitter and facebook. ….
  • We’ve made some significant investments in Coherence Cache Configuration for 12.1.2This presentation outlines some of the enhancements and flexibility of the new internal infrastructure for improving integration and extension of Coherence, especially by third-parties.
  • Coherence Configuration Enhancements - Part 1 - Injectables

    1. 1. <Insert Picture Here> Coherence 12.1.2 Configuration Enhancements Part 1: @Injectables Brian Oliver Senior Consulting Member of Staff Cloud Application Foundation - Oracle Coherence Oracle Fusion Middleware 12c Cloud Application Foundation Coherence 12.1.2
    2. 2. 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
    3. 3. The Agenda…
    4. 4. 4 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Coherence 12.1.2 Configuration Enhancements… • The Background… – Everything’s changed… but nothing has changed… • The Simple Improvements – Introducing @Injectable’s • Summary
    5. 5. The Objectives…
    6. 6. 6 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. The Objectives • Improve Integration with Third-Party Frameworks – Containers (WLS, GlassFish, et al) – Injection Frameworks (CDI, Spring, Guice et al) – Permit Third-Party & Open Source Development – Allow Independent “plug-in” Development for Coherence Servers • Allow Extension of Coherence – Add new custom features to Coherence • Provide Complete* non-Xml Programmatic Configuration
    7. 7. 7 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. What’s different? • Nothing… and everything! • Internally refactored… – Adopted a new internal Runtime Configuration Model – New Configuration Processing Model… that can be customized and extended! – Removed dependency on XML • Existing configurations should work without change
    8. 8. The Simple Improvements…
    9. 9. 9 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Old Style Cache Store Configuration <cache-config xmlns="http://xmlns.oracle.com/coherence/coherence-cache-config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="" xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-cache-config coherence-cache-config.xsd"> <caching-scheme-mapping> <cache-mapping> <cache-name>dist-*</cache-name> <scheme-name>distributed-scheme</scheme-name> </cache-mapping> </caching-scheme-mapping> <caching-schemes> <distributed-scheme> <scheme-name>distributed-scheme</scheme-name> <service-name>DistributedCache</service-name> <backing-map-scheme> <read-write-backing-map-scheme> <cachestore-scheme> <class-scheme> <class-name>MyOldStyleCacheStore</class-name> </class-scheme> </cachestore-scheme> </read-write-backing-map-scheme> </backing-map-scheme> <autostart>true</autostart> </distributed-scheme> </caching-schemes> </cache-config>
    10. 10. 10 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Old Style Cache Store Configuration public class MyOldStyleCacheStore extends AbstractCacheStore { @Override public Object load(Object o) { return null; // we're not going to support loading } @Override public void store(Object oKey, Object oValue) { System.out.println("Storing Key: " + oKey + ", Value: " + oValue); } @Override public void erase(Object oKey) { System.out.println("Erasing Key: " + oKey); } }
    11. 11. 11 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Old Style (with parameters) . . . <caching-schemes> <distributed-scheme> <scheme-name>distributed-scheme</scheme-name> <service-name>DistributedCache</service-name> <backing-map-scheme> <read-write-backing-map-scheme> <cachestore-scheme> <class-scheme> <class-name>MyOldStyleCacheStoreWithParameters</class-name> <init-params> <init-param> <param-type>string</param-type> <param-name>Cache Name</param-name> <param-value>{cache-name}</param-value> </init-param> </init-params> </class-scheme> </cachestore-scheme> </read-write-backing-map-scheme> </backing-map-scheme> <autostart>true</autostart> </distributed-scheme> </caching-schemes> . . .
    12. 12. 12 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Old Style (with parameters) public class MyOldStyleCacheStoreWithParameters extends AbstractCacheStore { private String m_CacheName; public MyOldStyleCacheStoreWithParameters(String cacheName) { m_CacheName = cacheName; } @Override public Object load(Object o) { return null; // we're not going to support loading } @Override public void store(Object oKey, Object oValue) { System.out.println("Storing Key: " + oKey + ", Value: " + oValue + " for Cache: " + m_CacheName); } @Override public void erase(Object oKey) { System.out.println("Erasing Key: " + oKey + " for Cache: " + m_CacheName); } }
    13. 13. Introducing @Injectable’s
    14. 14. 14 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. New @Injectable Cache Store public class InjectableCacheStore extends AbstractCacheStore { private String m_CacheName; @Injectable public setCacheName(String cacheName) { m_CacheName = cacheName; } @Override public Object load(Object o) { return null; // we're not going to support loading } @Override public void store(Object oKey, Object oValue) { System.out.println("Storing Key: " + oKey + ", Value: " + oValue + " for Cache: " + m_CacheName); } @Override public void erase(Object oKey) { System.out.println("Erasing Key: " + oKey + " for Cache: " + m_CacheName); } }
    15. 15. 15 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. New @Injectable Cache Store <cache-config xmlns="http://xmlns.oracle.com/coherence/coherence-cache-config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="" xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-cache-config coherence-cache-config.xsd"> <caching-scheme-mapping> <cache-mapping> <cache-name>dist-*</cache-name> <scheme-name>distributed-scheme</scheme-name> </cache-mapping> </caching-scheme-mapping> <caching-schemes> <distributed-scheme> <scheme-name>distributed-scheme</scheme-name> <service-name>DistributedCache</service-name> <backing-map-scheme> <read-write-backing-map-scheme> <cachestore-scheme> <class-scheme> <class-name>InjectableCacheStore</class-name> </class-scheme> </cachestore-scheme> </read-write-backing-map-scheme> </backing-map-scheme> <autostart>true</autostart> </distributed-scheme> </caching-schemes> </cache-config>
    16. 16. 16 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Introducing @Injectables • Applicable when Coherence is provided with an Object… – It will attempt to initialize it with appropriate @Injectables – Based on the “context” of Object usage – Before it uses the Object for the first time • eg: For <class-scheme> Coherence will try to inject… – cache-name, manager-context – ConfigurableCacheFactory, ClassLoader – Any other Named/Typed Resource from the Resource Registry
    17. 17. 17 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Introducing @Injectables • Javadoc defines what can be injected with @Injectable – Look in com.tangosol.coherence.config package • @Injectable’s Property Resolution… – Automatically uses Camel-Case of Setter Method to find a property • “setCacheName” method becomes “cache-name” property – Or… optionally specify “exact name” of the property @Injectable(“cache-name”) public void setSomeMethodName(String name) { … }
    18. 18. 18 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Introducing @Injectables • Where does this apply? – ClassScheme’s aka: <class-scheme> – Instance’s aka: <instance> – … customized namespaces! • Where not? – <partition-listener>
    19. 19. Summary
    20. 20. 20 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Summary • Coherence 12.1.2 introduces @Injectable annotation – Provides type-safe object injection – Automatically determines property names and types – Help reduces XML configuration requirement
    21. 21. 21 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Next Part? • Using Objects from other frameworks – Native integration – Avoiding the use of statics
    22. 22. Join the Coherence Community http://coherence.oracle.com @OracleCoherence /OracleCoherence blogs.oracle.com/OracleCoherence Group: Oracle Coherence Users /OracleCoherence coherence.oracle.com/display/CSIG Coherence Special Interest Group
    23. 23. 23 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. The proceeding is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
    24. 24. <Insert Picture Here> Coherence 12.1.2 Configuration Enhancements Part 1: @Injectables Brian Oliver Senior Consulting Member of Staff Cloud Application Foundation - Oracle Coherence Oracle Fusion Middleware 12c Cloud Application Foundation Coherence 12.1.2
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×