Help needed on Logging Servlet Implementation using high traffic HTTP Post

I have a servlet called LogServlet, which accepts the post HTTP request Data from another application and logs it into a file. The key thing here is the logs should get logged in a squence it is received.
Since the frequency of the data being sent is very high the LogServlet is not able to keep it up with the sequence and messing up the sequence.
Are there any suggestions on how to improve this and make sure the servlet logs it in the way it receives it?
Can I replace the Servlet with JSP to do the logging and will that solve my sequence issue?
Or there are any other techniques.
Thanking you in advance.

You could use the log4j logging tool, it uses a static Logger for the class and you can run it in synchronized mode to ensure that your log messages don't clobber each other. Hmm, you're testing my knowledge of how synchronization is implemented in Java. It uses a semaphore-style approach under the covers, but is it a fair-style (first-come, first-served) implementation?
After a quick Google search I just learned that in the normal VM fairness is not guaranteed, but if you use the Sun Real-Time VM synchronized will guarantee FIFO style access to synchronized resources. The Real-Time VM is not free, so if cost is an issue that might not be an option for you. That's going to make things more complicated for you since ordering sounds important.
You can probably write something fairly easily to do what you want. Basically write a queue processing class that uses either static methods/variables or a Singleton approach to ensure that your messages get processed in a FIFO order. Then just use your existing logging logic or use log4j to write your messages to a log file. There are several pitfalls to writing multi-threaded components like this, so be careful that you've synchronized the right methods and, depending on how you decide to implement it, use the right Queue implementation (hint: you may need to look in the java.util.concurrent package for your queue implementation, depending on the approach you take.)
One thing to note, this last approach may be overkill depending on what you mean by "very high frequency." If you're getting 10-20 requests a second, I think you still might be able to get away with log4j in synchronized mode. It also depends on how important the ordering really is. If one request arrives 500 microseconds after the other, is it okay to reverse the ordering? If so then syncrhonized log4j may still be okay. If not, then you're going to have to write something a little more sophisticated or take a closer look at the capabilities of the real-time VM.
Alternatively, someone who's more knowledgeable than me on the subject might be able to suggest a better approach using JMS.

Similar Messages

  • Why do we need to log in to use CS6 ???

    Hello all,
    I do some assistant editing at a film company and we have two suites of CS6 installed at work on two different computers. We also have the Adobe Creative Cloud now as well. I understand we need to log in to use softwares in the Creative Cloud but why the heck am I asked to log in to use software in CS6. For example, I open a Premier Pro file and then it asks me to log in. If I click cancel, it just closes Premier Pro. So ok I signe in but if someone can tell my whats up with that.

    This is most likely because the copy's licence has not been verified, and to verify it you need to log in so it can check that you account contains the license.
    It's just to prevent torrenting and piracy.

  • Upload XML data using XSQL and HTTP Post ?

    Upload XML data using XSLQ and HTTP Post: is that possible ?
    An xsql contains an <xsql:insert-request table="aTable">
    The XML data file follows the ROWSET/ROW paradigm.
    What is the HTML form to upload the xml file to the XSQL ?
    I tried:
    <form action="myXSQL.xsql" method="POST" ENCTYPE="multipart/form-data">
    XML data file to upload: <input type="file">
    <input type="submit">
    </form>
    But the answer of myXSQL is:
    <xsql-status action="xsql:insert-request" result="No posted document to process" />
    Where is the problem ?
    Thank you.

    Hello,
    You are posting your XML file as a parameter therefore you should use the <xsql:insert-params/> tag, not the <xsql:insert-request/>. The insert-request can only handle data not posted via a parameter.
    Usage:
    <form action="myXSQL.xsql" method="GET" ENCTYPE="multipart/form-data">
    XML data file to upload: <input type="file" name="myXML">
    <input type="submit">
    </form>
    in combination with
    <xsql>
    <xsql:insert-params name="myXML" table="your table"/>
    </xsql>
    2 remarks:
    I was not able to succesfully POST the form. The answer was <xsql-status action="xsql:insert-request" result="No posted document to process" />. With GET is was succesfull.
    Second, if you use MSInternet explorer 5 or higher use could post the XML directly (not aw parameter) using an ActiveX object.
    Regards,
    Harm Verschuren

  • Help needed in Multiple Receivers sceenarios using BPM

    Hi,
    I am new to BPM. As per my requirement, based on a business logic i may split the messages into two at message mapping. If i have spitted the messages into two, it should go to different receivers. Or if my logic hasnt splitted the mesaage means it should go to any one of the receivers. I also expect response from the receiver system once its done successfully.
    Could you help me how to do this using BPM?
    Thanks & Regards,
    Senthil.

    Hi,
    You can do it without BPM also, by using MultiMapping. If only splitting is required then I would suggest not to use BPM since it will consume much memory. Instead you can use multmapping.
    For Multimapping, go to messages tab in message mapping and select your different target structures and map it as per your requirement. In Integration Directory, go to advanced Interface Determination and proceed.
    Br,
    Madan Agrawal
    Edited by: Madan Agrawal on Feb 12, 2009 8:25 AM

  • Help needed to debug Communication Channel using Seeburger modules

    Hi ALL
    Can you please, help debug the following communication channel using File adapter & seeBurger module.
    Adapter Framework caught exception: I/O operation failed : java.lang.ClassNotFoundException: com.sap.engine.messaging.impl.spi.transport.PasswordCredentialImpl -
    Loader Info -
    ClassLoader name: [sap.com/com.sap.aii.af.app] Living status: alive Direct parent loaders:   [system:Frame]   [service:servlet_jsp]   [service:ejb]   [library:com.sap.xi.util.misc]   [service:com.sap.aii.adapter.xi.svc] Resources:   /usr/sap/KPX/DVEBMGS00/j2ee/cluster/apps/sap.com/com.sap.aii.af.app/EJBContainer/applicationjars/com.sap.aii.af.ejb.jar   /usr/sap/KPX/DVEBMGS00/j2ee/cluster/apps/sap.com/com.sap.aii.af.app/servlet_jsp/AdapterFramework/root/WEB-INF/classes   /usr/sap/KPX/DVEBMGS00/j2ee/cluster/apps/sap.com/com.sap.aii.af.app/servlet_jsp/AdapterFramework/root/WEB-INF/lib/com.sap.aii.af_api.jar -
    Delivering the message to the application using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.engine.services.rmi_p4.exception.P4BaseRuntimeException: I/O operation failed : java.lang.ClassNotFoundException: com.sap.engine.messaging.impl.spi.transport.PasswordCredentialImpl -
    Loader Info -
    ClassLoader name: [sap.com/com.sap.aii.af.app] Living status: alive Direct parent loaders:   [system:Frame]   [service:servlet_jsp]   [service:ejb]   [library:com.sap.xi.util.misc]   [service:com.sap.aii.adapter.xi.svc] Resources:   /usr/sap/KPX/DVEBMGS00/j2ee/cluster/apps/sap.com/com.sap.aii.af.app/EJBContainer/applicationjars/com.sap.aii.af.ejb.jar   /usr/sap/KPX/DVEBMGS00/j2ee/cluster/apps/sap.com/com.sap.aii.af.app/servlet_jsp/AdapterFramework/root/WEB-INF/classes   /usr/sap/KPX/DVEBMGS00/j2ee/cluster/apps/sap.com/com.sap.aii.af.app/servlet_jsp/AdapterFramework/root/WEB-INF/lib/com.sap.aii.af_api.jar
    Your help is greatly appreciated!
    Thank you,
    Patrick

    Hi Patrick,
    It seems that your seeburger instalation was not successfull.
    Try installing it again and make all the libraries are there.
    Regards,
    Luismier
    Edited by: Luismier on Aug 26, 2009 10:57 PM
    Edited by: Luismier on Aug 26, 2009 11:16 PM

  • Help needed with Export Data Pump using API

    Hi All,
    Am trying to do an export data pump feature using the API.
    while the export as well as import works fine from the command line, its failing with the API.
    This is the command line program:
    expdp pxperf/dba@APPN QUERY=dev_pool_data:\"WHERE TIME_NUM > 1204884480100\" DUMPFILE=EXP_DEV.dmp tables=PXPERF.dev_pool_data
    Could you help me how should i achieve the same as above in Oracle Data Pump API
    DECLARE
    h1 NUMBER;
    h1 := dbms_datapump.open('EXPORT','TABLE',NULL,'DP_EXAMPLE10','LATEST');
    dbms_datapump.add_file(h1,'example3.dmp','DATA_PUMP_TEST',NULL,1);
    dbms_datapump.add_file(h1,'example3_dump.log','DATA_PUMP_TEST',NULL,3);
    dbms_datapump.metadata_filter(h1,'NAME_LIST','(''DEV_POOL_DATA'')');
    END;
    Also in the API i want to know how to export and import multiple tables (selective tables only) using one single criteria like "WHERE TIME_NUM > 1204884480100\"

    Yes, I have read the Oracle doc.
    I was able to proceed as below: but it gives error.
    ============================================================
    SQL> SET SERVEROUTPUT ON SIZE 1000000
    SQL> DECLARE
    2 l_dp_handle NUMBER;
    3 l_last_job_state VARCHAR2(30) := 'UNDEFINED';
    4 l_job_state VARCHAR2(30) := 'UNDEFINED';
    5 l_sts KU$_STATUS;
    6 BEGIN
    7 l_dp_handle := DBMS_DATAPUMP.open(
    8 operation => 'EXPORT',
    9 job_mode => 'TABLE',
    10 remote_link => NULL,
    11 job_name => '1835_XP_EXPORT',
    12 version => 'LATEST');
    13
    14 DBMS_DATAPUMP.add_file(
    15 handle => l_dp_handle,
    16 filename => 'x1835_XP_EXPORT.dmp',
    17 directory => 'DATA_PUMP_DIR');
    18
    19 DBMS_DATAPUMP.add_file(
    20 handle => l_dp_handle,
    21 filename => 'x1835_XP_EXPORT.log',
    22 directory => 'DATA_PUMP_DIR',
    23 filetype => DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE);
    24
    25 DBMS_DATAPUMP.data_filter(
    26 handle => l_dp_handle,
    27 name => 'SUBQUERY',
    28 value => '(where "XP_TIME_NUM > 1204884480100")',
    29 table_name => 'ldev_perf_data',
    30 schema_name => 'XPSLPERF'
    31 );
    32
    33 DBMS_DATAPUMP.start_job(l_dp_handle);
    34
    35 DBMS_DATAPUMP.detach(l_dp_handle);
    36 END;
    37 /
    DECLARE
    ERROR at line 1:
    ORA-39001: invalid argument value
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 79
    ORA-06512: at "SYS.DBMS_DATAPUMP", line 3043
    ORA-06512: at "SYS.DBMS_DATAPUMP", line 3688
    ORA-06512: at line 25
    ============================================================
    i have a table called LDEV_PERF_DATA and its in schema XPSLPERF.
    value => '(where "XP_TIME_NUM > 1204884480100")',above is the condition i want to filter the data.
    However, the below snippet works fine.
    ============================================================
    SET SERVEROUTPUT ON SIZE 1000000
    DECLARE
    l_dp_handle NUMBER;
    l_last_job_state VARCHAR2(30) := 'UNDEFINED';
    l_job_state VARCHAR2(30) := 'UNDEFINED';
    l_sts KU$_STATUS;
    BEGIN
    l_dp_handle := DBMS_DATAPUMP.open(
    operation => 'EXPORT',
    job_mode => 'SCHEMA',
    remote_link => NULL,
    job_name => 'ldev_may20',
    version => 'LATEST');
    DBMS_DATAPUMP.add_file(
    handle => l_dp_handle,
    filename => 'ldev_may20.dmp',
    directory => 'DATA_PUMP_DIR');
    DBMS_DATAPUMP.add_file(
    handle => l_dp_handle,
    filename => 'ldev_may20.log',
    directory => 'DATA_PUMP_DIR',
    filetype => DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE);
    DBMS_DATAPUMP.start_job(l_dp_handle);
    DBMS_DATAPUMP.detach(l_dp_handle);
    END;
    ============================================================
    I dont want to export all contents as the above, but want to export data based on some conditions and only on selective tables.
    Any help is highly appreciated.

  • Help needed - automatic log in on public computer.   How to get rid of the account.

    Hi there
    Recently while on vacation, my son logged into a public computer on his ichat.  Unfortuantely, it was clicked as automatic log in.
    Now we are back home and have realized that someone has been accessing his account.
    We have tried deleting the account from our home computer, however, it does not delete it from the public computer.
    What will happen if we  change the password on our home computer?  Will the public computer be prompted to re-login with the new password, and therefore won't be able to?
    Help please

    hI,
    Yes change the Password and they will not be able to login.
    That is change the Password at the server you are using.
    Either AIM itself for AIM name or iForgot for @MAC.com or MobilMe names
    Login to your Google account and change the password there in your Account Settings
    With any other Jabber Account you will have to use the third Party app you used to get the accounst Name set up.
    Then Change it in iChat.
    10:25 PM      Sunday; June 26, 2011
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb( 10.6.7)
     Mac OS X (10.6.7),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously
    Message was edited by: Ralph Johns (UK)

  • Urgent help needed! How do I use Time Machine to restore my System disc?

    I need urgent help. First I discovered that my Library folder was empty. When I tried to restore the library to an earlier version via Timemachine it would not let me because it said the system was in use. Trying to start-up from another system on another internal drive and using various disc repairs resulted in the whole volume to disappear.
    Question is how do I get the earlier system from my Timemachine backup drive? I have another Mac where I can attach the TIme machine HD to. Can I restore it from there and then copy the files over to my corrupted disc? All my programs are on there as well, which would take me days to re-install and then there are the other bits, emails, photos etc. Can anyone help?

    lightandmagic wrote:
    Thanks for your sympathy Pondini and the encouragement. You just reminded me that I will lose a whole working day restoring !!! Do you happen to know where the emails are kept on the system and the address book? I better nick those as well as my other life sustaining bits before its too late. I don't trust anything any more.
    I don't know what you mean by "nick those." Time Machine will put everything back the way it was at the time of the backup (unless you'd excluded things).
    Do you mean you want to restore things from the period after the backup you selected?
    For Address Book or Apple Mail, start the application, then +Enter Time Machine,+ navigate to your latest backup, and you'll have a prompt to restore. For Mail, you can restore an entire mailbox. When you exit from TM, you'll see a new folder in your Mail sidebar with the restored items, so you can sift through them and move, delete, or leave them as you wish.
    Other items, you'll have to locate and restore via the Finder > Time Machine.

  • Expert help needed to connect iPhone / iPad using BlueTooth and Wi-Fi

    We need expert help to connect iPhone / iPad using BlueTooth and Wi-Fi. If you have worked with Apple MFi Program [http://developer.apple.com/programs/mfi], or have expertise/experience in this, please contact me. Thanks! Kevin.

    Hi there.
    I connected to my livebox after about three attempts. You have to pair the livebox by pressing either the number one or two that is on the box. When it is in pair mode it stays that way for ten minutes so it gives you chance to try your wep code that is on the bottom of the box a few times. I can't remember which one was successful but i did try the letters in uppercase and lower and one of them seemed to connect.
    Welcome to discussions by the way.
    Hope this helps JB

  • Help needed to log into an Open Directory account which has the same username as the local account

    Hello,
    I have successfully setup a Mac OS X Lion Server and it is an Open Directory Master. On the server Ihave created an account with the name 'Connor'. I have numerous Macs (allrunning OS X 10.7 Lion) connected to this server but on one of the Macs thereis a local account with the name 'Connor' too (the local and networked accountshave different passwords). I want to log into the Open Directory account onthat mac. So, I have done an authenticated bind to the server, but when I go tolog in the password box shakes. I think the computer thinks I am trying to loginto the local account and not the Open Directory account. On Windows, I canlog into either the local accounts or the networked accounts by typing\LOCAL-COMPUTER-NAME\Connor. So, I was wondering if there was a similar commandto do this on Mac.
    I don't think I haveworded this very well, so if someone doesn't understand please ask me somequestion about the problem and I will try and explain it better.
    Any help would be greatlyappreciated,
    Connor

    Maybe I didn't make myself clear. I have used directory utility to do an authenticated bind to my server. I also have no problem logging into other accounts in the Open Directory. But, I just can't log into the account which has the same name both in the Open Directory and locally.
    Was there something I missed in Directory Utility? Could you please help me if this is so.
    Thanks for replying so quickly

  • Help Needed "Camera not asking to use photo location when switched on"

    Hey guys, any help would be greatly appreciated.
    When I turn on my camera app it used to ask if I wanted to use the location. Now it does not, I am interested in seeing what I can do with the geotagging feature. I checked my settings, and use location is on. I turned it off, backed out, turned it back on again but nothing changed.
    When I open up maps and click the little round "find me" button, it works great.
    Any ideas on what I can do to get my camera app working again? Thanks in advance.

    If Location Services is ON, the geotagging data should be stored with the pics. The iPhone Photos app cannot display that information - you'd need to use a 3rd party app or upload the photo to a photo sharing website that supports geotagging data.
    If you want to see that 'use location' request from the Camera app, go to Settings > General > Reset and tap Reset Location Warnings.

  • Help needed in shopping cart implementation in JSP

    hi all,
    i need some help or code in implementing a shopping cart in JSP. Please send me code or any web resource.

    Hi!..i m in the same problem..if you have some idea or code..plz..
    robin_caba(@) yahoo.es

  • Help need on syntex of condition using Information Designer Tool 4.0

    I am new to BO.   Here is an illustration of the needs:
    1. I have a table mytab (col1, col2, col3). 
    2. add a custom dimension, called "mydim"
    3. click on SQL assistant to bring up SQL expression editor on "mydim".
    4.  Here what I need to do to define the outcome of mydim:
       *if value of col1 starts with 'A' then mydim=col1*
       *else if col2 starts with 'B' then  mydim = col2  and col1 concadnated else col3. .*
    I would appreciate help on the exact syntex to achive this.   Thx

    case when col1 like 'A%' then col1 when col2 like 'B%' then col1+col2 else col3 end
    try out this option if your database in sql server. If your backend database is oracle then use || instead of +symbol in the above syntax.
    one more this you need to consider is the priority of the conditions in the case statement. for example is there any possibility of getting rows with  col1 values starting with A and also col2 values starting with B , in that case which one u need to display

  • Help needed - HP Bladesystem architecture implementation

    Hi, I'm about to build an infrasctructure which will support an Oracle VM environment.
    First step will include:
    - 1 enclosure (c3000)
    - 1 blade (hp bl460c) with Qlogic FC HBA
    - Ethernet switch for c-class bladesystem module for blade connectivity (hp GBe2C)
    - Optical FC Switch for c-class bladesystem module (brocade switch SAN 4/12 AE370A)
    - FC Storage (HP MSA 2012FC)
    In the first phase, the devices will not be redundant. This will be just for effective functionality test of Oracle VM Server environment, and for workload test on a single Blade.
    Phase 2 will include adding a second blade server to test HA and VM guests migration.
    Now, THE QUESTION:
    Given that I'm trying to save as much money as possible on phase 1, I was thinking to use (as described before) JUST ONE BLADE for VM Server. And I was planning to use a cheap, classic, small tower server for VM Manager (the console for the environment) EXTERNAL TO THE BLADESYSTEM ENCLOSURE.
    IS THIS POSSIBLE? I mean. Will I be able to have connectivity to the blade inside the enclosure? I'm new to bladesystems, never seen one before, but it seems to me that there are some limitations for connectivity outside the enclosure, even if I will have the HP GBE2C switch on the backplane of the enclosure itself.
    Additional info: The blade server, apart the FC HBA, will have 2 gigabit eth cards. I was thinking to use one of those 2 to be shared by the VM Guest Machines, and the second interface would be dedicated to connectivity toward the VM Manager Machine.
    I really hope to get an opinion from somebody who has been actually working on these architectures. In the end, what I need to know, is if I can initially use an external server for hosting VM Manager or if I need to buy a second blade server right away.
    Thank you very much.

    Hi Eike, thank you for adding your valuable feedback. Just keep in mind that FOR NOW, I don't have anything ready, so I don't have direct experience, but it' very good for me to hear that you are profitably using an architecture that is very close to what I have in mind (given that in max 2 weeks I'm going to buy the hardware).
    In a matter of fact, what I want to achieve is to have maximum flexibility and minimum costs. And, everything you wrote makes sense to me (to answer your first question).
    To answer your second question, I noticed what could be a slight difference with what I want to put up. Actually, I want to set up DISKLESS blade server(s), and implement SAN boot, straight from the FC storage. So, each blade will see 2 LUNs, there will be one LUN dedicated to each blade, and will contain Oracle VM Server installation. Then a second LUN, bigger, OCFS2 formatted, that will be shared across ALL the blades, to allow guest machines HA, live migration, etc.
    I'm thinking of putting everything on the storage, because I believe that in the end I'll be able to save money on local disks, and also it'll be easier to calculate the right amount of space to dedicate to each VM server installation, maximizing resource usage. I think it'll be much easier to manage too, because taking advantage of the snapshot/cloning features of the storage device, full backups of ALL the machines will be included, very quick and easy, at least in my mind.
    Then you highlighted another point, but regarding this particular thing I think you took the best decision... I'm talking about the 2 eth ports. I didn't know that you could use this BOND0 logical device... To improve availability and to balance network traffic too. So, I think I'm going to study this possibility when it'll be time to implement something "real". Until yesterday, what I was thinking i would do, would have been to use one of the network cards to be shard across the virtual guest machines, and to use the other card to "communicate" with the VM manager console (the external server). But I did believe that VM manager console actually NEEDED to have a dedicated network card (don't ask me why, just an idea that I made up without any real foundations).
    Finally, the external VM manager server. In the beginning (phase 1 of my project), JUST TO SAVE MONEY, I'm planning to re-use a spare server. But if we go in production, I think that in the end I will dedicate another diskless blade server just for VM cosole. Backups will be included in the scheduled snapshots/cloning of the storage, maximizing flexibility and safety, at least in my personal opinion. As for saving money using an already existing DB as repository, I think I'll use Oracle XE on this machine (it is free, and Oracle itself recommends it as a very good solution to store VM manager repository).
    What do you think?
    Looking forward to your feedback,
    Thank you
    Roberto
    Edited by: rlomba on 8-feb-2009 15.02

  • Help needed understanding final keyword and  use 3

    Hi Everyone,
    I have been studying a book on multi-threading and have inadvertently come accross some code that I don't really understand. I am wondering if anybody can explain to me the following:
    1). What effect does using the final keyword have when instantiating objects, and
    2). How is it possible to instantiate an object from an interface?
    public class BothInMethod extends Object
         private String objID;
         public BothInMethod(String objID)
              this.objID = objID;
         public void doStuff(int val)
              print("entering doStuff()");
              int num = val * 2 + objID.length();
              print("in doStuff() - local variable num=" + num);
              // slow things down to make observations
              try{
                   Thread.sleep(2000);
              }catch(InterruptedException x){}
              print("leaving doStuff()");
         public void print(String msg)
              String threadName = Thread.currentThread().getName();
              System.out.println(threadName + ": " + msg);
         public static void main(String[] args)
              final BothInMethod bim = new BothInMethod("obj1");  //Use of final on objects?
              Runnable runA = new Runnable()      //Creating objects from an interface?
                   public void run()
                        bim.doStuff(3);
              Thread threadA = new Thread(runA, "threadA");
              threadA.start();
              try{
                   Thread.sleep(200);
              }catch(InterruptedException x){}
              Runnable runB = new Runnable()
                   public void run()
                        bim.doStuff(7);
              Thread threadB = new Thread(runB, "threadB");
              threadB.start();
    }If you know of any good tutorials that explain this (preferably URL's) then please let me know. Thanks heaps for your help.
    Regards
    Davo

    final BothInMethod bim = new BothInMethod("obj1");  //Use of final on objects?
    Runnable runA = new Runnable()      //Creating objects from an interface?          
         public void run()               
                                    bim.doStuff(3);               
    };Here final is the characteristics of bim reference variable and it is not the characteristics of class BothInMethod
    This means u cannot use bim to point to some other object of the same class
    i.e, u cannot do this
                       final BothInMethod bim = new BothInMethod("obj1"); 
                       bim  =  new   BothInMethod("obj2");  This bim is a constant reference variable which will point only to the object which it is initialized to
    and not to any other object of the same class later on.
    How is it possible to instantiate an object from an interface?Regarding this yes we cannot create an object from an interface but
    but here it is not an interface u are providing the implementation of the interface Runnable
    as
    new Runnable()
    }This now no longer stays an interface but now it is an object that implements the interface Runnable

Maybe you are looking for