How to create an object alive all the time on a server side

Hi,
I work on an Intranet with J2EE technologies. I need an object to do several tasks in background on the server side. Like start scheduled processes on a database and files, stocked on the server. What is the way to do this. I thought to use the JNDI by declaring the object in the Deployement Descriptor, and to manage a timer within.
I don't know if this works.
Anyway, my question is how to create an object on the server that is ALIVE ALL THE TIME and visible by the other objects running in the same VM.
Thank's.

This may not be the correct design, but I had success doing the following:
1. Create an Stateless EJB that does a task, i.e. update a database table.
2. Create a subclass of java.util.TimerTask to call the EJB methods.
3. Kick off the TimerTask from a servlet.init method.
Seems to work pretty well to do scheduled tasks, such as refreshing lookup tables. I would imagine the same could be done with an MBean, but I haven't had time to fully understand JMX yet. (It's on the list).
As for event driven procedures, that can be done through a servlet interface.
You may also wish to review a scheduler here: http://www.part.net/quartz.html. Note, I have NOT even looked at it yet, so I have no clue if it's any good. But, it is on my list of tools to evaluate (that's a long list) someday when my head's above water. Have a look, and caveat emptor.
Hope this helps,
Perry Tew

Similar Messages

  • Am a member, but work alone, don't have a team. How do I explain this, getting all the time the note: "We are having trouble verifying your membership" Adobe means the team membership/

    Am constantly receiving this note, when I open my Photoshop:
    When the first subscription year ended, last August, I purchased again a subscription to Photoshop CC 2014 and Lightroom (from another provider and for less money), nothing else, as these 2 are what I need being a photographer.
    I'm freelance and work alone. There is definitely no team with me. So why do I need a team membership/account????

    There is no problem in working with my Photoshop. I work with it all the time. I'm only afraid that at Adobe they think that I had not paid for the software. It's true that I didn't pay for a team subscription, but for sure paid for the software, and I didn't find, on opening the link, how to prove this:
    Hi Rachel Hirsch,Your order has been confirmed, congratulations! 
    Please keep this confirmation as your proof of purchase. If you paid by credit card, the charge for your order will appear on your credit card statement as "DRI Adobe Sales”.(E-commerce services are provided by Digital River International SARL, an Adobe approved e-commerce reseller)
    Order Details
    Order Number: 12791658425
    Order Date: 24 July 2014
    Seller Address
    Digital River International S.a.r.l.
    98 Boulevard Du Prince
    L-1724 Luxembourg, Luxembourg

  • How to keep internet PPPoe On all the time?

    Ok so here is the low down, right now every time i turn on my IMac and want to get the internet. I have to do it manually. as in go to system preference and select network and turn on PPPoe directly from the menu every time i turn on the computer.
    Is there anyway to keep the internet on all the time and have it connect automatically without going into menu settings every time.
    Thanks

    Here, you can study this - its pretty simple code that I wrote for one of my own students to develop;-import java.awt.*;
    import javax.swing.*;
    public class Baller extends JFrame implements Runnable{
       int top, bottom=250, left, right=250, x=100, y=100;
       boolean down=true, forwd=true;
       public Baller(){
          JPanel pan = new JPanel(){
             public void paintComponent(Graphics g) {
                super.paintComponent(g);
                g.fillOval(x,y,30,30);
          pan.setOpaque(false);
          getContentPane().add(pan);
          setSize(290, 310);
          setDefaultCloseOperation( EXIT_ON_CLOSE );
          new Thread(this).start();
       public void run() {
          while (true) {
          if(down) y++;
          else y--;
          if(forwd) x++;
          else x--;
          repaint();
             if(x > bottom) down =false;
             if(x < top)    down =true;
             if(y > right)  forwd=false;
             if(y < left)   forwd=true;
             try {
                Thread.sleep(10);
             catch (InterruptedException e) {
                break;
       public static void main(String[] args){
          new Baller().show();
    }

  • AppleTV and iTunes without Leaving Computer On All The Time/NAS iTunes Server

    I begrudge having to leave my iMac on all the time just so now and again I can play music, pictures and video from it through AppleTV. My iMac is 2 floors up from the AppleTV, and as there is no wake on LAN working (I can't get it to work if there is (I have Lion)) I don't want to go up there to turn the Mac on when I want to use AppleTV.
    So I have read some articles about iTunes servers on NAS drives and wondered if that would be a good solution, anyone try them?
    If I did have my iTunes library on a NAS drive with an iTunes server, when I start iTunes on my iMac will it then load the iTunes Library as it does now like if it was a local library? So I can still manage it in the same way as I do on my Mac.
    I assume then I could have another computer use the same library on the NAS? (although wont do it the same time due to conflicts)
    I have iCloud/Match so not so bothered about music as I can play from the Cloud (although its hit ad miss sometimes), but I have videos and pictures I stream to AppleTV so they are more important. I don't want to have a computer left on all the time so I can use AppleTV.
    If this is not possible, then I am thinking of getting a Macbook for the lounge, but then I don't want to have to plug/unplug my external hard drives into it all the time, which I am likely to swap with the main iMac too.
    Thanks a lot

    P.S. I only play music from iCloud as my iMac is not on. So if I can stream to AppleTV without having a computer on, then I would do that to be faster, work all the time, and save bandwidth.

  • How to create index not unique at the time of the CREATE TABLE

    Hi,
    I am trying to find out how in Oracle create secondary indexes that can accept duplicated into the CREATE TABLE statement, without have to execute a CREATE INDEX separately.
    As far I can see the only syntax accepted by Oracle 9i to create more than one index at the time of the table creation is:
    CREATE TABLE test_tab (x INTEGER, y INTEGER, z INTEGER PRIMARY KEY(x,y), UNIQUE(z))
    But, in my case I need to have the unicity only for the primary key, but not for the second index, that I would like to have not unique.
    How to do that inside of the CREATE TABLE statement?
    Any help?
    Thanks a lot in advance.

    To create an index automatically (not constraint related) , you will need to have an 'event' trigger on the schema that will (IE: detecting a table create/drop matching ARCHIVE_%) , generate the appropriate SQL required (create index sql) and pass THAT to a DBMS_JOB.
    Make sure you have job queue's enabled.
    This was the ONLY way that I could re-create a view automatically as new tables were created that matched a criteria IE ARCHIVE_JAN06, ARCHIVE_FEB06 etc.
    The application's "archiving" method created and was thus aware of these tables and permitted searching within 'archived' data, but 3rd party reporting applications needed to see a view encompassing all data, regardless of the tables involved. The view automatically created was a 'union_all' of all tables concerned.

  • How can create room in icloud for the time machine on the mac

    I don't like to be carrying a time capsule around. Just need some space in the icloud for the Time Machine. Is that too hard to do?

    vcngu wrote:
    Backing up a Macpro in icloud shouldn't be rocket science or is it?
    No, it is very simple really, iCloud does not back up from Time Machine, or any other OSX program come to that. iCloud IS NOT an OSX backup system.

  • When i walk away for 5 min the browser goes offline how do i keep it online all the time?

    when i step away form the computer firefox goes offline after a few minutes how do i stop this i need firefox to stay online

    You can create a new Boolean pref with the name network.manage-offline-status and set the value to false.
    You can right-click on the about:config page to open the right-click context menu and use "New > Boolean" to create a new Boolean pref.
    Name: network.manage-offline-status<br />
    Value: false
    To open the <i>about:config</i> page, type <b>about:config</b> in the location (address) bar and press the "<i>Enter</i>" key, just like you type the url of a website to open a website.<br />
    If you see a warning then you can confirm that you want to access that page.<br />

  • All the time slips in the working environment, how to fix this error?

    All the time slips in the working environment, how to fix this error?

    All the time slips in the working environment, how to fix this error?

  • Imac error all the time

    i have i mac and still have apple care series : W8602P4TU2P
    and you can see the problem i have got here :
    http://www.tienpow.com/apple-broken/
    I have all the error image show to you and when i go to support in thailand they do nothing for me.. please advice me how to do
    And it freeze all the time when it show that error line.. then freeze. I have to reboot.. very very annoying and my jobs are gone too..
    I need you to advice me how to do because thailand support do noting for me..
    please contact and advice me at [email protected]
    thankyou

    I would try these things;
    1. Run Repair Permissions from the install disk.
    2. Run Hardware Test from the install disk.
    3. Try creating another user account and see if the problem continues.
    3. Do a clean install of the system software if steps 1 & 2 find nothing.
    lenn
    Message was edited by: lenn5

  • How to create an object within the same class???

    hi im just a newbie
    i v been always creating an object from the main class..
    but how to create an object inside the same class??
    i got main and students class
    the main got an array
    Students[] stu = new Students[]
    and i got
    stu[i] = new Students(id,name);
    i++;
    but i wanna do these things inside the Students class..
    i tried ..but i got errors.....
    how to do this
    .

    javaexpert, :)
    I really have no idea what you are trying to do since you say you've always been creating an object from the main class, yet you always want to create an object inside the same class.
    I'll assume that you have an object in the main class that you are trying to access from the Students class.
    If you are trying to access objects that are contained within the main class FROM the Students class, then know that there are two ways of doing so, one being static, and the other dynamic (look up definitions if unclear):
    1.) make the objects in the main class both static and public and access the the objects using a convention similiar to: Main.object; It's important to note that Main is the name of your main class, and object is a static object. There are better ways of doing this by using gettter/setter methods, but I'll omit that tutorial.
    2.) Create a new instance of the main class and access the objects using a similiar fashion: Main myInstance = new Main(); myInstance.myObject;
    You should really use getter and setter methods but I'll omit the code. In terms of which approach is better, step one is by far.
    I don't mean to be condecending, but you should really brush up on your programming skills before posting to this forum. This is a fundamenetal concept that you will encounter time and time again.

  • How can I easily create a playlist contain all the songs on my iPhone

    How can I easily create a playlist containing all the songs on my phone? I have iOS 7.1.1. on the iPhone. Older versons of iOS had a one button operations to add all songs. iOS 7 does not seem to have this one button operation, which requires me to add songs individually. Considering I have over 1500 songs on my iPhone this takes a long to to do.

    It has always been very basic to always maintain a backup copy of your computer for this very occasion.  Use your backup copy of your computer to put everything on the new one.
    If for some reason you have failed to backup, big mistake, then you can transfer itunes purchases from the iphone to the computer:  File>Transfer Purchases
    You may be able to buy a 3rd party program to get any other music off of the iphone ( not supported by Apple).
    When you sync the iphone, it will erase the current content and replace with content form the new computer.
    "Not happy with itunes right now, more then a bit of a joke"
    Not itunes fault that you did not do the very basics and maintain a backup copy.

  • How to create an object for this Question...

    i want to create an object to Factorial.java, but the class is in String object... how can i do that
    please help me with code how to create an object
    String str = Factorial.java;
    i tried to do like this
    str s1 = new str();
    this way is not working...
    thank u

    yes sir am trying to instantiate and retrieve the metadata, am a student am asked to do Program Analyzer, while fullfilling the application requirements i came across this situation, like i have to find total number of public methods in any source file that is entered as input.
    Am taking the input in String variable, i can have the details of the source class only of i instantiate and create an Object to that....
    Please suggest me some way to do that... JAVA is so interesting am working on the project since 2 weeks am done with all other classes but struck here finding the total number of methods...
    Thank you

  • How to create an object of a class?

    plz read the question carefully ..
    how to create the object of a class by giving the class name as an String
    suppose i have a java file name:" java1.java ".
    so now how to create an object of this class "java1"by passing a string "java1"..

    kajbj wrote:
    rajeev-usendi wrote:
    thanks but still i have problem..
    i have created the object but now i m unable to do anything with that created object..
    i have coded like this..
    Object o= Class.forName("java1").new Instance();
    after this i m unable to do anything with the object 'o'..So why did you create the instance? You can also get all methods using reflection, but that is probably not what you want to do. You should instead let the class implement an interface and cast the created object into that interface ans call the methods that you want to call.
    KajI agree with Kaj. If you need to use a class that's unavailable at compile time, you should create an appropriate interface by which to refer to the class and then you create instances reflectively and access them normally via their interface (which is called reflective instantiation with interface access)

  • How to create good object model?

    Does anybody know how to create good object model?
    Again and again I have to create different object models in various projects. I have to solve a lot of problems.
    - Define all entities
    - Create objects for it
    - Define relations (ususlly i use SQL Databases)
    - Define methods to load/edit/save/delete entities.
    - Define methods to search and featch set of entities
    - Define events for entities (fired when it change)
    - the biggest problem is the events for collections. If i got the collection of entities for filter [FirstName = 'Sam'] i want to recieve event NewEntityAdded(), when new entity with FirstName='Sam' is created. But i want not to recieve event when that new entity's FirstName = 'Jack'.
    Do anybody know good book or set of articles for such a questions?

    Hi Facedown12,
    Does the issue resolved based on the Tatynan's suggestion? If the issue persists, please post the detail information about
    your issue, so that we can make further analysis.
    Regards,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Salmple at How to Create Dynamical Object for RTTC

    Hi all, I need a sample at How to Create Dynamical Object for RTTC.
      you can help me?.

    Hello Martinez,
    I have attached a sample for structure types. With the Where-Used-List on the Create() Method of the various RTTC classes one may find more samples. If you meant with object on OO Type then it is to mention that this is not possible yet.
    Regards
      Klaus
    PROGRAM sample.
    DATA: sdescr1 TYPE REF TO cl_abap_structdescr,
          sdescr2 TYPE REF TO cl_abap_structdescr,
          tdescr1 TYPE REF TO cl_abap_tabledescr,
          tdescr2 TYPE REF TO cl_abap_tabledescr,
          tref1   TYPE REF TO data,
          tref2   TYPE REF TO data,
          comp    TYPE abap_component_tab,
          wa      TYPE t100,
          xbuf    TYPE xstring.
    FIELD-SYMBOLS: <tab1> TYPE table,
                   <tab2> TYPE table.
    sdescr1 ?= cl_abap_typedescr=>describe_by_name( 'T100' ).
    comp     = sdescr1->get_components( ).
    sdescr2  = cl_abap_structdescr=>create( comp ).
    tdescr1  = cl_abap_tabledescr=>create( sdescr2 ).
    tdescr2  = cl_abap_tabledescr=>create( sdescr2 ).
    CREATE DATA: tref1 TYPE HANDLE tdescr1,
                 tref2 TYPE HANDLE tdescr2.
    ASSIGN: tref1->* TO <tab1>,
            tref2->* TO <tab2>.
    wa-sprsl = 'E'. wa-arbgb = 'SY'. wa-msgnr = '123'. wa-text = 'first text'.   INSERT wa INTO TABLE <tab1>.
    wa-sprsl = 'D'. wa-arbgb = 'SY'. wa-msgnr = '456'. wa-text = 'second text'.  INSERT wa INTO TABLE <tab1>.
    wa-sprsl = 'D'. wa-arbgb = 'XY'. wa-msgnr = '001'. wa-text = 'third text'.   INSERT wa INTO TABLE <tab1>.
    wa-sprsl = 'D'. wa-arbgb = 'ZZ'. wa-msgnr = '123'. wa-text = 'fourth text'.  INSERT wa INTO TABLE <tab1>.
    wa-sprsl = 'E'. wa-arbgb = 'SY'. wa-msgnr = '123'. wa-text = 'ABAP is a miracle'. INSERT wa INTO TABLE <tab1>.
    EXPORT tab = <tab1> TO DATA BUFFER xbuf.
    IMPORT tab = <tab2> FROM DATA BUFFER xbuf.
    LOOP AT <tab2> INTO wa.
      WRITE: / wa-sprsl, wa-arbgb, wa-msgnr, wa-text.
    ENDLOOP.

Maybe you are looking for

  • FTP from Solaris 10 to Windows Hangs on some PDF files

    Documents containing images and Eastern European characters have been PDF'd on Windows machines (XP) using various versions of Adobe Acrobat (5 and 8 certainly), and are uploaded to Web Serving apps running on Solaris 10 systems. Retrieval of the PDF

  • To Include link to URL in FORM_UIBB for Personal Deatil view

    Hi Experts, I have requirement to include the Link to URL in the Form UIBB for Personal Deatil . The form UIBB is built using the Fedder Class - CL_HRESS_PER_DETAIL. The Fedder class get the Structure in the - IF_FPM_GUIBB_FORM~GET_DEFINITION fom the

  • Aspects Developer "Verifier jar file not found error"

    Hello all. I'm working in a Java Card project and I have some troubles. When I tried to compile, verify and load my solution in Aspects Developer's Software, I achieved the following error message: " could not found Verifier jar file". So I couldn't

  • Bouncycastle, sun app server 8.1, jar is not signed by a trusted signer

    hi, i am facing following problem, im trying to use 3rd party security provider signed with SUN, however, after everything is properly configured and i run webapplication code (sun app server 8.1) that should load registered 3rd party provider applic

  • How To transform to anyType element in 10g?

    HI, How to map to anyType element in Jdeveloper 10g in transform activity? Is it supported? I think in 11g, we can use copy-of construct. What is the alternative in 10g? Thanks Manish