Created
July 28, 2011 18:13
-
-
Save riferrei/1112147 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.oracle.coherence.demo; | |
import com.tangosol.net.CacheFactory; | |
import com.tangosol.net.NamedCache; | |
public class LerPIUsandoCoherence { | |
public static void main(String[] args) { | |
// Garante que este programa faça parte do grid... | |
CacheFactory.ensureCluster(); | |
// Solicita ao Coherence a recuperação do cache criado... | |
NamedCache constantes = CacheFactory.getCache("constantes"); | |
// Recupera a variável do cache e imprime na saída padrão... | |
double pi = (Double) constantes.get("pi"); | |
System.out.println("Valor da variável PI: " + pi); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment