How can I access the Oracle CEP from the a simple java code

I want to access the current values in coherence cache and show those in a screen. So for that I want to create a java class which can access the Coherence cache of the CEP application and get the current values in the Cache.
Do anyone had any sample code for this, or any idea how to do this.

As mentioned, you can use Spring to pass a reference to your cache to an event bean as shown below.
Once you have a reference to the cache you can use whatever Coherence APIs you need.
For example: get an object based on the key, perform an invoke, or a query to get the values that you want to display.
Here's some sample code:
IN EPN
<wlevs:caching-system id="CoherenceCachingSystem" provider="coherence" />
<wlevs:cache id="TransactionCache" caching-system="CoherenceCachingSystem"
          value-type="TransactionAmount" key-class="com.oracle.poc.event.TransactionAmountKey">                                   
</wlevs:cache>
<wlevs:event-bean id="TransactionCacheQuery" class="com.oracle.cep.eventbeans.TransactionCacheQuery">
     <wlevs:listener ref="P1TotalChannel" />
     <wlevs:instance-property name="transactionCache" ref="TransactionCache" />
</wlevs:event-bean>
EVENT BEAN:
import com.tangosol.net.NamedCache;
import com.tangosol.util.aggregator.DoubleSum;
import com.tangosol.util.filter.EqualsFilter;
public class TransactionCacheQuery implements StreamSource, StreamSink {
     private StreamSender streamSender_;
     @SuppressWarnings("unchecked")
     private Map transactionCache;     
     @SuppressWarnings("unchecked")
     public void setTransactionCache(Map transactionCache) {
          this.transactionCache = transactionCache;
     public void setEventSender(StreamSender sender) {
          streamSender_ = sender;
     public void onInsertEvent(Object event) throws EventRejectedException {
          if (event != null){
               if (event instanceof MyEvent){
                    MyEvent my = (MyEvent)event ;
                    NamedCache cache = (NamedCache)transactionCache ;
                    Object totalAmount = cache.aggregate(
                              new EqualsFilter("getACCT_NUMBER", my.getACCT_NUMBER()),
                              new DoubleSum("getAmount"));
                    double transactionsTotal = 0.00 ;
                    if (totalAmount instanceof Double){
                         transactionsTotal = ((Double)totalAmount).doubleValue();
                    my.setTransactionsTotal(transactionsTotal);
                    // send new event to the processor
                    streamSender_.sendInsertEvent(my);     
}

Similar Messages

  • I upgraded to the new IOS, but lost data and apps. When I try and restore the only backup I see is the one made AFTER the lost data. How can I access an older backup from the cloud?

    I upgraded to the new IOS, but lost data and apps. When I try and restore the only backup I see is the one it made AFTER the lost data. How can I access an older backup from the cloud?

    Why don't you talk to apple and find out if backup exists? That conversation with apple will stop your guessing.

  • How can i access my icloud files from the finder?

    I have tried dragging the icloud icon from the toolbar of safari to the toolbar of a finder window without success.  There are files from apps I would like to save on my cloud that do not natively support iCloud. 
    Thanks in advance for your help.
    -Fricaseed

    The Safari iCloud icon is for iCloud tabs which syncs all of your tabs in Safari between all of your iOS devices and Macs. So basically while you were dragging the iCloud icon into Finder, you were doing nothing. Also iCloud only saves information and files from certain applications such as Reminders, Notes, Messages, Safari, TextEdit, etc. If there are apps that do not natively support iCloud you cannot save their files to iCloud because Apple does not have a feature that can save any file from any app on your Mac. Sorry to tell you this.
    Hope this helps,
    - Daniel 

  • How can I access a shared calendar from the web ?

    Hi !
    I use OSX SL, iCal 4.0.4, MobileMe.
    When I share an ical calendar, I can not access it from the web. I can share it with other ical users, but can not find the correct url to access it from Safari. I have been searching the net and find suggestions, but all of them is about using the url stated in the share-dialog. When I share a calendar, there is no url for web access.
    Hope someone can help.
    Sveino

    There is a method for publishing a MobileMe calendar to a web page (as can still be done with an 'On My Mac' calendar, though of course that won't sync to other devices).
    The method is almost a hack, and depends on what appears to be a bug in iCal, so there is no guarantee that it will work, or continue to work, or won't cause problems. Also it appears that once published the calendar cannot be removed from the web page, even if the original is deleted.
    With those caveats in mind, please see this web page:
    http://homepage.mac.com/rfwilmut/notes/icalpublish.html
    Note that there is a simpler method, involving exporting your MobileMe calendar as an .ics file, re-importing it as an 'On My Mac' calendar, and publishing it in the usual way. However of course it won't update if you update the MobileMe version, and if you make it the only version then of course it won't sync to MobileMe. It's one or the other, or use the hack described above.

  • How can I access SCXI gain settings from the niconfig.daq file using Labview 6.1?

    I'm using NT, Labview 5.0 and NI-DAQI 6.8.1. also LV 6.1 w/NI-DAQ 6.9.2 and would like labview to determine the current SCXI gain settings. How can I parcel the ni-config.daq file into text?

    Hi,
    niconfig.daq is a binary configuration file and cannot be parced into a text file; the format of the data stored in it is not available.
    Regards,
    RamziH.

  • How can I access my iCloud account on the web from my phone

    how can I access my iCloud account on the web from my phone
    iPhone 5 iOS 8.3
    I have iCloud turned on, location services on, find my phone works but when I try to access iCloud via Safari on the phone it takes me to a page Apple.com,
    iCloud then three options
    set up iCloud on my phone (i have)
    Install Find my phone, it is installed and it works from my MBP
    or install find my friends, I don't need that I have no friends.
    my calendars and contacts and bookmarks and all are all sync'd and working on the phone, but i thought if I typed in iCloud.com on the phone in Safari I would go to my iCloud web page that looks like this on my Mac.
    Is that NOT how iCloud should/would look on my phone via Safari?
    This is maybe a dumb question after 3+ year of iPhone'ing
    thank you for clarifying or helping me to understand
    jojoguitar_mmn_usa

    I've been playing with a Galaxy here at work and here's what I've found so far - please feel free to jump in and suggest alternative methods to configure or access the various icloud components.
    So the original Q: Can you access your icloud account on Android?
    Not entirely: the website can't be used from an android browser (not properly - even with Dolphin HD and posing as different browsers it won't load correctly.  So Find my iphone is out, so is the address book or looking at your e-mail or calendar just in a browser window
    I was able to setup my e-mail using the IMAP settings published here:
    http://support.apple.com/kb/HT4864
    Be sure to setup the account manually - and note if you have trouble using SSL try TLS (that worked for me)
    Address book is a no go so you'll have to use iTunes to sync all your contacts over to Gmail - if you still have an iPad it means managing contacts in two places though .  Same goes for your calendar - transfer it to Gmail and forget about iCloud's calendar.  Nice instructions here: http://howto.cnet.com/8301-11310_39-20064060-285/how-to-switch-from-iphone-to-an droid/
    iWork is an Apple proprietary bit so don't expect much there.
    So in my case, if I'm really going to make the switch to a Galaxy from my iPhone it really means I'm going to have to switch to using google as the backend.  The timing to swap over to a galaxy/android phone is not the greatest - given that I'd have to give up my Apple addiction (syncing photos and itunes and losing access to my device tracking).  Plus I still have an iPad and a mac and like living in the Apple ecosystem.  I think I'll wait and see what the new iPhone looks like before I commit

  • How can I access my music library from a laptop on the road, as if my PC is not active? I tunes is installed on both PC and Home Sharing is enabled on both devices.

    How can I access my music library from a laptop on the road, as if my PC is not active? I tunes is installed on both PC and Home Sharing is enabled on both devices.

    The key constraint for Home Sharing in this context is that both PCs need to be on the same wifi network. So once you get out of range of the wifi network covering your home PC, the laptop is not going to be able to Home Share.
    Have you considered importing your iTunes music to the laptop? Then you could listen to a local copy of the music on the laptop while you're on the road. (You can do the import via home sharing when both computers are on the same wifi network.)

  • How do you access updates to apps from the App store after changing to a new ID because the password on the old ID was changed and you don't know what it is now?

    How do you access updates to apps from the App store after changing to a new ID because the password on the old ID was changed by the former husband and you don't know what it is now?  And you set up your own new ID and account but can NOT access the updates, from the App store for the many apps that you already have, because they require that you sign in with that former now inaccessible ID and account and password?  Call it a problem of modern times and changing relationships, if you want to be charitable.

    So I guess it will only be new apps that I download that are allowed to give me their updates while 13 updates wait for me on an ID I can no longer access.
    Yes...  sorry.
    In the future, if need be, you can re download your purchases for free  >  Downloading past purchases from the App Store, iBookstore, and iTunes Store
    Good rule of thumb is to back up your purchases regardless  >  Mac App Store: Backing up your app purchases

  • How can I access a calendar backup from my old iPhone?

    How can I access a calendar backup from my old iPhone?
    I recently had to get a replacement iPhone 4. The tech at the Apple Store thought that I might have had a software problem and recommended that I not "restore from backup," but start this phone as a new device and just sync the apps and what-not. My calendar on my computer was different than the one on my old phone, though, and now I need the data from my old iPhone calendar. I did back up my old phone just prior to taking it to the Apple Store.
    HELP!

    Well what you can do is update to ios5 then use icloud to sync your calandar up to your phone then restore your phone as new and when prompted in the new phone setup put in your icloud username and password and you will have your calandar events back.

  • HT1766 HOW CAN I CHANGE MY BACKUP FOLDER FROM THE C DRIVE TO ANOTHER?????

    HOW CAN I CHANGE MY BACKUP FOLDER FROM THE C DRIVE TO ANOTHER????? because my c drive in the windows computer gets filled and i need to back up my ipod to a portable hard disk.. bt i dont know how to do it.. plz help

    you can't change the backup folder as far as I know, but you can choose to move backups. The information you need can be found in this article: http://support.apple.com/kb/ht4946
    Where iTunes backups are stored on your computer
    The folder where your backup data are stored varies depending on the computer's operating system.   Make sure the backup folder is included in your periodic data-backup routine.
    iTunes places the backup files in the following places:
    Mac:  ~/Library/Application Support/MobileSync/Backup/
    Windows XP:  \Documents and Settings\(username)\Application Data\Apple Computer\MobileSync\Backup\
    Note: To quickly access the Application Data folder, click Start, and choose Run. Type %appdata% and click OK.
    Windows Vista and Windows 7:  \Users\(username)\AppData\Roaming\Apple Computer\MobileSync\Backup\
    Note: To quickly access the AppData folder, click Start. In the search bar, type %appdata% and press the Return key.
    Hope this helps
    Regards,
    Stijn

  • HT2954 How can I access my imac mail from a different computer other than Apple?

    How can i access my imac email from a differnt computer other than
    apple?

    If you are using IMAP mail connection (IMAP keeps the  mail on the server), then you just configure the other computer's mail client to access the same account.
    If you are using a POP mail connection, then the mail is generally downloaded to your Mac and deleted from the server.  That is a much more difficult problem to solve.  NOTE:  Google's gmail does have a POP option that does NOT delete the mail on the server, so it is accessible via the gmail web page.
    A lot depends on what you are using for your mail service and whether you are using IMAP or POP protocols.

  • How do you access your itunes library from the icloud on your ipad

    How do you access your itunes library from the icloud on your ipad?

    You have asked two different questions?
    Your account is just a user name and password.  You can access that to buy content from any computer with itunes, just sign it.
    Your library wil only be where your put it. Yo can copy it from one computer to another, or from your backup copy of your computer ot another computer. In some countries you can download some past itunes purchases.
    Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • How can I remove a mailbox address from the "From" drop down box in a new e-mail my old e-mail address continue to populate as the sender address

    How can I remove a mailbox address from the "From" drop down box in a new e-mail my old e-mail address continue to populate as the sender address

    Hello,
    Try Mail>Preferences>Accounts icon>Account Information tab>Click on the Outgoing SMTP server drop down, choose edit Server list, highlight the old one & click Remove.
    (Such convolution is worthy of Windows® in my estimation)

  • How can open a html, pdf files from the server (c:\foldername\filename)

    Hi all,
    I am developing an application. in this app i have to implement RMI.
    My problem is this, How can a client open a files from the server.
    all the html, pdf files are stored in the server's directory like C:\audit\filename.
    There is a folder on the server's C directory which contains all the html , pdf files.
    please tell me how can a client open a file from the server using RMI.
    Please send me the solution as soon as possible.
    Thanks & Regards
    Bhavishya

    That's doing it the hard way. Why not use HTTP or FTP?

  • How can I move photos in iPhoto from the WEB Photo Stream or WEB Facebook to one of my Events?

    How can I move photos in iPhoto from the WEB Photo Stream or WEB Facebook to one of my Events?

    From PhotoStream either drag the photos form PS to the iPhoto window or set the iPhoto peference to automatically import PS photos
    From Facebook save to isk and import from there
    LN

Maybe you are looking for

  • Error installing SQL Server Management Studio Express on Windows Vista RC1

    Hello NG, After installing SQL Server 2005 Express Edition on Windows Vista RC1, I wanted to install also the Managent Studio but I always receive the following error message: "Bei der Installation dieses Pakets ist ein unerwarteter Fehler aufgetrete

  • Customer Service Problems

    After fighting with Verizon customer service over two service issues without any possibility of resolution I am canceling my account.  I’m doing this reluctantly because as a long-term shareholder of Verizon I would like to see the company succeed an

  • Using the print command in SQL Plus

    When using the following syntax: PRINT :msg, I am finding it difficult to suppress the header 'msg.' Is there someway to do this in SQL Plus? Thanks for your feedback!

  • Trying to install Arch on a SD card.

    I have an EEE PC 900 and was trying to install arch on a 32gb sd card. Every kernel I have tried so far boots then during bootup says it cannot find the root drive.  I tried changing the root delay but that didn't work.  So far I tried the defalt ker

  • ORA-1093 during Database Recovery in 11g R2

    1. PSEUDO Process present in the standby db preventing the switch to recovery mode (initiated by the application) Excerpt from the alert log Active process 0 user '' program 'PSEUDO' Active process 0 user '' program 'PSEUDO' Active process 0 user ''