Skip to content

Instantly share code, notes, and snippets.

@piotrMocz
Created May 19, 2015 07:54
Show Gist options
  • Save piotrMocz/fbe5a3131789fb51adf7 to your computer and use it in GitHub Desktop.
Save piotrMocz/fbe5a3131789fb51adf7 to your computer and use it in GitHub Desktop.
Ice ice baby.
public class NewsReceiver extends _FinancialNewsReceiverDisp {
private static final long serialVersionUID = -3538248252658050588L;
public static HashMap<CurrencyPair, Float> exchangeRates = new HashMap<>();
public static HashMap<Currency, Float> interestRates = new HashMap<>();
@Override
public void interestRate(float rate, Currency curr, Current __current) {
interestRates.put(curr, rate);
System.out.println("Adding new interest rate!");
}
@Override
public void exchangeRate(float rate, Currency curr1, Currency curr2,
Current __current) {
exchangeRates.put(new CurrencyPair(curr1, curr2), rate);
System.out.println("Adding new exchange rate!");
}
}
/// a to w serwerze:
Ice.ObjectPrx fProxyBase = ic.propertyToProxy("FinancialNewsProxy");
FinancialNewsServerPrx fProxy = FinancialNewsServerPrxHelper.checkedCast(fProxyBase);
Identity ourIdentity = new Identity(UUID.randomUUID().toString(), "");
NewsReceiver receiver = new NewsReceiver();
FinancialNewsReceiverPrx newsReceiver = FinancialNewsReceiverPrxHelper.checkedCast(adapter.add(receiver, ourIdentity));
fProxy.registerForNews(newsReceiver);
fProxy.ice_getConnection().setAdapter(adapter);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment