The two clients are these two scripts below which use a class in coherence.jar as follows
coherence.cmd - com.tangosol.net.CacheFactory
query.cmd (New In Coherence 3.6) - com.tangosol.coherence.dslquery.QueryPlus
1. Create a new empty project in JDeveloper
2. Add 2 classes as follows for each client.
coherence.cmd - com.tangosol.net.CacheFactory
package pas.au.coherence.utils; import com.tangosol.net.CacheFactory; public class JdevCoherenceClient extends CacheFactory { public JdevCoherenceClient() { } }
query.cmd (New In Coherence 3.6) - com.tangosol.coherence.dslquery.QueryPlus
package pas.au.coherence.utils; import com.tangosol.coherence.dslquery.QueryPlus; public class JdevCoherenceQueryClient extends QueryPlus { public JdevCoherenceQueryClient() { } }
3.At a minimum if we use the default cache config file in coherence.jar we simply need to create a run/debug/profile for each client as follows. This is the example for the QueryPlus client where the config is called "CoherenceQueryClient"
Notice how I have set the JVM propery -Dtangosol.coherence.ttl=0 to avoid joining any clusters outside my own machine. Basically this will ensure no packets are sent from my machine. You would specify any other properties here for coherence such as -Dtangosol.coherence.cacheconfig if you have your own config file. Also the "Default Run target" is set to the class we created above which will then use the class we extended.
4. In that dialog select "Tool Settings" and ensure "Allow program Input" is checked as we need to type at the command prompt.
5. Now run your config select the Run icon in the toolbar and then selecting one of the 2 config you created.
Output in the log window would be as follows