Your SlideShare is downloading. ×
0
Coherence Configuration Enhancements - Part 1 - Injectables
Coherence Configuration Enhancements - Part 1 - Injectables
Coherence Configuration Enhancements - Part 1 - Injectables
Coherence Configuration Enhancements - Part 1 - Injectables
Coherence Configuration Enhancements - Part 1 - Injectables
Coherence Configuration Enhancements - Part 1 - Injectables
Coherence Configuration Enhancements - Part 1 - Injectables
Coherence Configuration Enhancements - Part 1 - Injectables
Coherence Configuration Enhancements - Part 1 - Injectables
Coherence Configuration Enhancements - Part 1 - Injectables
Coherence Configuration Enhancements - Part 1 - Injectables
Coherence Configuration Enhancements - Part 1 - Injectables
Coherence Configuration Enhancements - Part 1 - Injectables
Coherence Configuration Enhancements - Part 1 - Injectables
Coherence Configuration Enhancements - Part 1 - Injectables
Coherence Configuration Enhancements - Part 1 - Injectables
Coherence Configuration Enhancements - Part 1 - Injectables
Coherence Configuration Enhancements - Part 1 - Injectables
Coherence Configuration Enhancements - Part 1 - Injectables
Coherence Configuration Enhancements - Part 1 - Injectables
Coherence Configuration Enhancements - Part 1 - Injectables
Coherence Configuration Enhancements - Part 1 - Injectables
Coherence Configuration Enhancements - Part 1 - Injectables
Coherence Configuration Enhancements - Part 1 - Injectables
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Coherence Configuration Enhancements - Part 1 - Injectables

396

Published on

Watch on YouTube: …

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
396
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
15
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
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 <class-scheme>, <instance> and custom namespaces. Partition-related schemes not supported in 12.1.2 eg: partition-listener, but <interceptors> 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 <class-scheme>, <instance> and custom namespaces. Partition-related schemes not supported in 12.1.2 eg: partition-listener, but <interceptors> 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.
  • Transcript

    • 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 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. The Agenda…
    • 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. The Objectives…
    • 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 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. The Simple Improvements…
    • 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 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 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 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. Introducing @Injectable’s
    • 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 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 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 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 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. Summary
    • 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 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. 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 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. <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

    ×