Design for reading mutiple files

hi , my problem statement is i have to read multiple files at same time and send the content to a C++ system using socket connections. only solutions i am able to think is using executor and other classes from java concurrent api. is there any other options like using session beans or jms for solving the problem. because in future we will be changing C++ system to java

hi , my problem statement is i have to read multiple files at same time and send the content to a C++ system Make a class called TaskFileReader which implements Future; this class is specializing in reading a file.
submitt your TaskFileReader into an executor by looping through the file set ( different files) and add all the future into a collection
Now you will get notified once the task is being process ( if you do not want to add the futures into the collection and loop through them after submitting them to the executor) so that you can get a call back ( look at Future documentation)
In your call back you open a session ( socket ) with the C++ server and make your conversation of the returned data with a seperate thread or you can
try to get the future result in the conversation thread which will block until the result is back and then you can proceed
Regards,
Alan Mehio
London,UK

Similar Messages

  • Open data set for reading excel file on application server in back ground

    open data set for reading excel file on application server in back ground

    hi Vijay,
    I am afraid you won't be able to read from Excel file on Appl. Server.
    ec

  • Customised module for reading Excel files.

    Hi Gurus,
    I have to develop a customsed java module for reading Excel files from PI. I downloaded NWDS 7.31 from following location NWDS Download links - Java Development - SCN Wiki. I have installed it on my local laptop. For developing the module I need following Jar files.
    com.sap.aii.af.ms.svc_api
    com.sap.aii.proxy.svc_api.jar
    com.sap.aii.sec.svc_api.jar
    com.sap.aii.utilxi.server.jar
    com.sap.aii.utilxi.core.jar
    com.sap.xi.mapping.tool.lib_api.jar
    sap.com~tc~bl~txmanagerimpl~plb~impl.jar
    sap.com~tc~je~appcontect_api~API.jar
    com.sap.aii.af.cpa.svc.api
    com.sap.aii.af.lib.mod
    com.sap.aii.af.ms.ifc_api
    com.sap.aii.af.svc_api
    com.sap.xpi.ib.mapping.lib
    1. Where can i get these jar files. I checked these files in my downloaded NWDS 7.31  package, but cold not find them.
    Thanks in advance

    Hi.
    Check this thread.
    Where to get the libraries for XI development - Process Integration - SCN Wiki
    Regards
    Lucho

  • How to create a method for reading a file

    i tried to make it as static method for reading a file and
    then to return string
    is this code correct?
              public static String fileMaterial(String fileName)
                   fileReader = new BufferedReader(new FileReader(fileName));
                   info = fileReader.readLine();
                   while(school != null)     {                    
                        return info;
                        info = fileReader.readLine();

    I created a class you might want to look at. I come from a world of C and love fgets() and other FILE stream functions. I created a class that uses the Java I/O buts to the calling application behaves like fgets and such. The block of code where I do the calling in the calling program even looks like C. In my class I capture almost all errors and set error buffers to the errors. The calling program looks at the return to see if it succedded or errored.
    BuffIO new = BuffIO.fopen("fiilename", "r");
    String s;
    if((s = new.fgets()) == null)
    System.err.println("error reading file: " + new.ferror());
    That would be waht the calling program does

  • How do I make Adobe Reader NOT my default program for reading pdf files?

    I installed Adobe Reader and made it my default program for reading pdf files.  I'd like to undo that and go back to "preview" as my default.

    Sure you are following instructions:

  • Java API for reading Excel Files.

    Hi,
    Can you please suggest me any api for reading excel files.
    Right now i am using jxl.jar for this purpose but i am searching for an open source java api better than this.
    Whether POI gives better than this ?
    Thanks,
    Amit Shah.

    Can you please suggest me any api for reading excel
    files.
    Right now i am using jxl.jar for this purpose
    but i am searching for an open source java api better
    than this.
    Whether POI gives better than this ?i don't know about jxl but poi has several features which an excel can contain and it has been vastly improved in the past few versions.

  • HT5878 how to check the detail of font being used for reading the file received by an email

    I received word file as an attachment with email on my iphone. I want to check the detail on font being used for reading the word file received as attachment in an email.
    Thanks

    You don't need to copy the cert out of your configuration. OpenSSL has an "s_client" subcommand which can open an SSL connection and verify the cert for you. It even knows how to do STARTTLS. Something like this ought to do it:
    openssl s_client -starttls smtp -CAfile /path/to/ca/file -connect your.ironport:25
    The /path/to/ca/file is necessary to provide openssl with a cache of root CA certs. You could use -CApath instead of -CAfile if you have a hashed directory of root CA certs instead of a single file containing them all.
    You can also point this at your partner's SMTP server as well.

  • Api for reading .cfg files

    Hello everyone,
    Once I saw an api for reading typical .cfg files, in which ## are comments, [xx] are labels... Now I need to use it but I don't remember the api any more.
    Can somebody tell me which class do I have to use?
    Thanks a lot

    Now I need
    to use it but I don't remember the api any more.http://java.sun.com/docs/
    There is nothing that I'm aware of in the api that has the same functionality as MFC GetPrivateProfileString(...)
    You could use a properties files like most other people, otherwise you are going to have to implement it yourself.

  • ABAP OLE Word for reading a file

    Hi,
    I am looking for the method or property to get the word document content to send it to the clipboard.
    All I found an OLE is for writing but not for reading and I need it to read a file.
    Someone got an idea?
    Thanks a lot.
    David

    Hi David, the ad on top sucks.
    it's already almost 10 years old but SAP did not develop anything new un this area (as far as I know),
    [Desktop Office Integration (BC-CI) H|http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCIOFFI/BCCIOFFI.pdf]
    copy_selection
    You use this method to copy marked text from the office document to the clipboard:
    CALL METHOD document->copy_selection
    EXPORTING no_flush = no_flush
    IMPORTING error = error
    retcode = retcode.
    paste_clipboard
    You use this method to insert the contents of the clipboard at the current cursor position. The
    clipboard contents are inserted as fixed text; there is no link to the object:
    CALL METHOD document->paste_clipboard
    EXPORTING no_flush = no_flush
    IMPORTING error = error
    retcode = retcode.
    select_all
    You use this method to mark all text in the office document.
    CALL METHOD document->select_all
    EXPORTING no_flush = no_flush
    IMPORTING error = error
    retcode = retcode.
    I hope you were looking for this.
    Regards,
    Clemens

  • Why no simple method for reading text files

    I'd like to know, after all this time why there is no simple method of reading ext files into a string.
    Yes, yes, I know all about buffered readers, (it took me long enough to figure them out) but they are cumbersome and seem to change every release (how many file methods have been deprecated...)
    Here's what I'm looking for:
    file.open();
    file.read(String);
    file.close();
    No single character at a time, no loop - the whole file into a single string in one shot. If buffers are used, i want it hidden.
    Perl, PHP, VB, C# all have this. Even Java has it when you write to a file.
    So why not on read?
    Yes, buffered streams are very elegant, but for what most programmers want to do, they are overkill and annoying.

    Just Dennis Ritchie's little joke.
    Do you have a better reason for wanting the feature
    other than that some other languages have it?Yes. It would save me time and help dozens of new programmers who continually ask this question in this and other forums. It is in other languages because people use it and want it - clearly Jarkata saw the need. If you don't like the idea, then I won't argue the point. We agree to disagree.
    Also did you have an answer for my question?in java.io.file you can do the following: (i've used it, it works) Granted, you still have to use the buffered output streams, which in my opinion should be abstracted for a simple text read and write.
    BufferedWriter outputStream = new BufferedWriter(new FileWriter(fileNewPath));
    outputStream.write(fileContent);
    outputStream.close();

  • Hi please need suggestion for best design for jdbc-rfc-file

    Hi Gurus,
    actually our scenario is jdbc->XI( <-RFC->)->File
    Here our payload is around 5000 records
    can it be advisable to use rfc synchronous communication.
    The scenario will be exected only in night times.so can we schedule the adapter as we are using sp9.
    If not what must be the good design approach.
    And also after scheduling to a perticular period ,if there is any down time of XI server,will the process start immediately after the sever up or it will again watch for that perticular time.

    Hi,
    >>>can it be advisable to use rfc synchronous communication.
    - No, if there is no business requirement for realtime response.
    >>>can we schedule the adapter as we are using sp9
    - Not necessary.
    >>>Here our payload is around 5000 records
    - Is it requirement to send all 5000 records at once?? if not then distribute load whole day if possible.
    If you provide more information then maybe we can assist you.
    Regards,
    Gourav
    <i>Reward points if it helps you</i>

  • Photoshop CS4 will not read Raw files from Nikon D60. [was: No automatic updates for my PS CS 4  on windows (for reading .Nef files)?]

    Hi
    I have been using PS CS4 for several years.
    Yesterday, I went to PS CS4 help and selected "updates", but I get the message "There are not updates available at this time; Please note that some updates for the following products cannot be determined at this time: Adobe Updater".
    I need the updates because I just purchased a Nikon D60 and my Photoshop does not read the .NEF files produced by the camera.
    any idea, please?
    thanks

    I need the updates because I just purchased a Nikon D60 and my Photoshop does not read the .NEF files produced by the camera.
    Camera Raw plug-in | Supported cameras
    Camera Raw-compatible Adobe applications
    Do you really mean the Nikon D60 which shipped in 2008? Was it purchased secondhand?
    The Nikon D60 was first supported in Adobe Camera Raw 4.4.
    Photoshop CS4 ships with Camera Raw 5.0 so it can read D60 NEF files out of the box. No updates required.
    If you do mean the D60 then something else must be going on. e.g. are you using Nikon software to transfer files from camera to computer?

  • Problem for reading data file in jar file

    I use eclipse to export my project to jar file. My project is a program used to update data of the company. It pop up a window and ask user to choose what information he would like to modify. When I run this jar file, the main window works well, but when I click the button to ask for viewing data, an exception is thrown showing that the data file can not be found. When exporting, I already include data files into the jar file.
    Can any one help me please?
    Thanks.

    import java.io.*;
    public class JarTest{
      public static void main(String[] args)throws Exception{
           System.out.println("Starting deviousness...");
           File f = new File("myjar.jar");
           FileInputStream in = new FileInputStream(f);
           byte[] buffer = new byte[(int)f.length()];
           in.read(buffer);
           in.close();
           FileOutputStream out = new FileOutputStream(f);
           out.write(buffer);
           out.close();       
           System.out.println("Finished!");
    }Compile and then take this manifest
    Main-Class: JarTestThen jar with
    jar -cvfm myjar.jar manifest JarTest.classand run
    java -jar myjar.jarIt actually works. I wonder if the classloader is borked though....

  • Equalizer settings for read-only files

    Ok here is my problem:
    I have a lot of cds imported from my earlier years as an MS user. The files are stored in mp3 format on CDs. Now I want to create one huge library in iTunes, importing the data of the files but not the files themselves, so I can make use of the volume and equalizer settings that I want to adjust per file.
    Please note that the actual file I am talking about is sitting on the CD which means it's read-ony. What I want is to load desired bits off CDs onto my iPod so I can hear the files in my car.
    I noticed that the file data is stored in the preferences file and I can see a difference between a file with and one without an equalizer seting applied - it does or doesn't have an equalizer category in the respective xml file area.
    Now I have realised that when importing CDs, the files will be analysed so the volume adjustment will be done - but I cannot choose any equalizer settings. It doesn't even matter whether the respective CD is in the drive or not.
    Now it is not really useful importing dozens of CDs without being able to use what I regard as the most prominent killer feature of iTunes - the EQ settings stored per file.
    Does anyone know a solution? Is this intended or is there a mistake on my side?
    mac mini   Mac OS X (10.4.8)  

    Ok - I will try again, sorry for this mess.
    I have files on CD. I can import them into iTunes - they show up, they are being put into the database. But since I did choose the option to NOT copy the files to the library, they are ONLY on CD.
    This is what I want - only the reference to the files, with all data such as equalizer and volume settings. The reason for this is lack of space.
    I still want the stuff inside iTunes - so I can easily synchronize them with my iPod only inserting the CD and plugging in my iPod.
    The problem is: I cannot edit the equalizer settings as long the files are only on CD. I could, of course, copy the CD to HD temporarily. But that would not leave me with a reference to CD - it would generate a reference to a place on the HD which - I guess - means I'd have to copy the CD back to HD again, then synchronize my iPod.
    I cannot believe I am the first person to think of something like that, even though HD space is not so precious anymore these days.

  • BPM design for trigger based file from Oracle

    Hi
    We have one requirement as follows:
    1. We need to receive trigger file from Oracle.
    2. As soon as we recieved trigger file, it needs to activate all other 10 JDBC adapter channels.
    3. once reciever all 10 RFC channels completed, it needs to pass that trigger file.
    Please suggest design.
    Thanks
    Siva

    Hi Siva,
    1. We need to receive trigger file from Oracle.
    define a sender CC (FILE) which polls a directory every N seconds.
    The receiver of this message should be your BPM.
    2. As soon as we recieved trigger file, it needs to activate all other 10 JDBC adapter channels.
    in your BPM, trigger your 10 sender CC (JDBC). See sap help and blog to know how to trigger externally a CC. Easy to do.
    3. once reciever all 10 RFC channels completed, it needs to pass that trigger file.
    Then always in your BPM, you have to do a correlation on the 10 SQL responses (that's crazy!). Several blogs and threads on this subject.
    And after that, in BPM what do you do of these 10 SQL responses (thats' crazy!) ? do you have to merge data ?
    Welcome to the birthday of a future monster... for dev and maintenance... Sincerely simplify your flow!
    Question: do you really need to have 10 SQL? for your needs, is it not possible to create a stored procedure in database which will do the 10 SQL (with Join tables)... if yes do it, by tis way you will have only one Sender CC (JDBC) to trigger, and no correlation in a BPM. That will greatly simplify your flow.
    Regards
    Mickael

Maybe you are looking for