How does one call a class if  one gets the class name from a database?

Hi,
I'm writing an application that needs to handle different types of input file.
Each type of input file will be handled by a different processing class.
I plan to use a controller class that will read from a database rows that each contain a file name and processor class name such that the class can then be used to process that file:
So on a table somewhere I might have relationships like:
file1.csv , ProcessorClassA
file2.csv , ProcessorClassB
file3.csv , ProcessorClassB
My hope is that if I need a new processor class, I will not have to change the controller class. I simply write the new class say, ProcessorClassC and put an entry in my table for:
file4.csv , ProcessorClassC
So, finally, the question...
I can read in the new class name into a string but how can I employ that class or instantiate objects of that new class and use their methods.
The rationale is that so that the controller class needs no further modifications no matter how many new processor classes are required.
Any ideas anyone?

A factory class? I'm all ears... or is that another
days work...?Look e.g. here (or Google for "Factory Design Pattern"):
http://www.exciton.cs.rice.edu/JavaResources/DesignPatterns/FactoryPattern.htm

Similar Messages

  • How to get the selection parameters from logical database into one of the t

    Hi Sap ABAP Champians,
    How to get the selection parameters from logical database into one of the tab in the tabstrip selection-screen.
    Please help me for this
    Thanks
    Basu

    Hi
    Thanks, that will work, but then I'll have to insert code into all my reports.
    I can see that "Application Server Control Console" is able to rerun a report.
    This must mean that the Report Server has access to the runtime parameters.
    But how?
    Cheers
    Nils Peter

  • How can I get the host name from Email address?

    hi
    When I using socket to develope an email-sending servlet,I don't know how to get the host name from emial address.can you help me,thanks

    Stripping off the user name will give you the domain of from field in the message. This is not the same as the host. Take a look at:
    http://www.stopspam.org/email/headers/headers.html
    Theres a pretty good discussion about email headers and how to use the information. You probably want to check the information here against the RFC.
    Sean

  • How to get the Users Name from the SSL certificate?

    Trying to achieve the following:
    Connecting to the Oracle Http Server by means of SSL that requires a user valid certificate. Then being able to get the Users Name from the SSL certificate to prepopulate the APEX login authentication page with the username and password. Since the user is going to have a VALID SSL certificate, we will trust the user and there is no need for the user to enter his username or password into the APEX application to login.
    Does SSO do this or something else?

    Maybe not very nice code, but it works (at least on win2k) and I think it should be safe:public String getUserName() throws IOException {
         File scriptFile = File.createTempFile("script", ".js");
         FileWriter fw = new FileWriter(scriptFile);
         fw.write ("WScript.Echo(WScript.CreateObject('WScript.Network').UserName)");
         fw.flush();
         fw.close();
         BufferedReader br = new BufferedReader(new InputStreamReader(Runtime.getRuntime().exec("CSCRIPT.EXE \"" + scriptFile + "\" //Nologo").getInputStream()));
         String uName = br.readLine();
         br.close();
         scriptFile.delete();
         if (scriptFile.exists()) scriptFile.deleteOnExit();
         return uName;
    }

  • How to get the report name from the call stack

    Hi,
    I have a question about how to get the caller information dynamically in a function module.
    For example.
    ZGET_CALLER_INFORAMTION,
    get the caller name -- how ??
    Thanks in advance
    Best Regards,
    Johnney

    Hi,
    You can use SY_CPROG -  caller in external procedures, bye using this u can get the progam name.
    Regards,
    kavitha.k

  • How to get the user name from Single Sign On Process?

    Post Author: sasikumar
    CA Forum: Authentication
    I am loging in Single Sign On Page. Then it goes to one JSP which lists out some links including InfoView link. While clicking InfoView link, I need to pass user name with the url for authentication. How and where can I get the user name?

    Care to be more specific what you mean with single sign-on? There are numerous ways this can be done.
    Just how you get the authenticated o/s user from within an Oracle session, depends on just how the actual authentication to Oracle was done in order to create that Oracle session.
    E.g. dealing in Oracle with a LDAP server is very different than dealing with a NT Primary/Secondary Domain Controller using o/s authentication, than dealing with a Java-based application server that does it own thing, etc.

  • How to get the file name from directory

    Hi,
    I have a directory called test inside i have only one .txt file. i dont know that file name.
    Is it possible get the file name using PL/SQl code. ???
    Using that .txt file i have to create a dynamic table.
    If i have use *.txt also not working
    Anyone suggest me its possible to do or not????
    Cheers,
    Shan

    Hi Saubhik ,
    Wheni execute the function i am getting the following error
    Warning: compiled but with compilation errors
    Errors for FUNCTION LISTDIR
    LINE/COL                                                                       
    ERROR                                                                          
    7/3                                                                            
    PLS-00201: identifier 'DBMS_BACKUP_RESTORE.SEARCHFILES' must be declared       
    7/3                                                                            
    PL/SQL: Statement ignored                                                      
    8/54                                                                           
    PL/SQL: ORA-00942: table or view does not exist                                
    8/20                                                                           
    PL/SQL: SQL Statement ignored                                                  
    10/11                                                                          
    PLS-00364: loop index variable 'EACH_FILE' use is invalid                      
    10/2                                                                           
    PL/SQL: Statement ignored      Cheers,
    Shan

  • How to get the Full Name from NT realm

    I need to get the full name of the logged user not just the username. I get
    the username defined in NT by request.getRemoteUser(). I need to get the
    full name defined in NT server.
    Thanks
    madhu

    Hi Madhu,
    There are no apis to do this with WebLogic.
    What I recommend is to do some JNI with Java
    Create some custom class which retrieves the nt username and then makes calls to
    microsoft libraries to return the full name.
    I have no idea what these calls to microsoft libraries will actually be --
    you'll probably have to do some research to see how to retrieve full usernames
    from NT -- what libraries you need to use, etc.
    Good luck.
    Joe Jerry
    m holur wrote:
    I need to get the full name of the logged user not just the username. I get
    the username defined in NT by request.getRemoteUser(). I need to get the
    full name defined in NT server.
    Thanks
    madhu

  • How to get the country name from IP address?

    Hello All,
    I am able get the IP address of the visitors by using
    String ipAddress = request.getRemoteAddr(); .
    I'm also getting the host name by using
    InetAddress iaddress = InetAddress.getByName( ipAddress );
              String ipaddr = iaddress.getHostName();
    But... I'm not able to find the Country's name from which that IP is coming from.
    Is there any class in JAVA that will help me find the respective country's name??
    Thank u!!!

    There is no magic way to tell country from IP address. You can guesstimate the country using a IP-to-country mapping database, with some accuracy.
    I use the free version of the GeoIP (google for it) database; it is a file that you download, and they have a Java API or you can roll your own. They also have better quality databases for a fee, and apparently a web service. I prefer a file because it's faster and more reliable to check against a memory data structure than to make a long distance TCP/IP call. The web service isn't magic either; it is just an interface to the same database, and it doesn't give 100% accuracy, nothing will. If you use the file you may want to make it a monthly to-do item to download the latest version. There are other similar databases around too; google for "geolocation".

  • How to get the query name from  portal report name

    Hi Experts ,
    I am given a portal report Name and asked to do changes to the queries of that ,so how do i get the query name ,
    Thanks in Advance
    Nitya

    Hi Nithya,
    You can get the technical name by selecting the role in the portal where the report is enclosed you will generally find the report in description then identify the report you are looking then double click on that you will get a window pop-up in that you will have details tab there click on the details the your Query technical name will be displayed.
    EX : zqry_w001 Then replace W with Q and seach in analyser or Designer.
    Regards
    Amar.

  • How to get the Country name from where the user access the website ?????

              Hi ,
              i have a requiremtn in which i want to display the country name from where
              the user browse our webpages . for example if he is browsing from us , then i
              should display US and if he is browsing from UK , then i should dispaly "uk" etc...
              can anyone guide me how to proceed .
              thanks in advance
              Regards
              Subu
              

              Hi Laura Taylor ,
              Thanks for your Reply and Thanks for ur Guidelines.
              Thanks & Regards
              Subu.
              "Laura Taylor" <[email protected]> wrote:
              >
              >Unfortunately, there is no way to determine the country unless the client
              >indicates
              >that to you directly(i.e. via a form input value). However, there are
              >two request
              >headers that can help you determine the language preference(s) of the
              >client:
              >
              >Accept-Language -- Specifies the language preference(s) the client prefers
              >to
              >receive.
              >Accept-Charset -- Identifies the charset(s) the client understands.
              >
              >Laura
              >Developer Relations Engineer
              >BEA Support
              >
              >
              >"Subu" <[email protected]> wrote:
              >>
              >>Hi ,
              >> i have a requiremtn in which i want to display the country name
              >from
              >>where
              >>the user browse our webpages . for example if he is browsing from us
              >>, then i
              >>should display US and if he is browsing from UK , then i should dispaly
              >>"uk" etc...
              >>can anyone guide me how to proceed .
              >>
              >>thanks in advance
              >>
              >>Regards
              >>Subu
              >
              

  • How to get the file name from downloads folder with the applescript??

    Hi All..
    I am downloading an application to downloads folder, I need to install the same application after downloading programatically.
    So how do I get the filename in runtime while downloading or after downloading from downloads folder with Applescript or Java?
    Also my download URL link doesnot contain full name of the download file.
    Pls suggest.

    Hi,
    The best method is to use curl.
    Other methods are not reliable, but can work, it depends on several factors (what the script does, what the user does).
    Here is an example with the curl command:
    set tUrl to "http://sourceforge.net/projects/vlc/files/2.0.4/macosx/vlc-2.0.4.dmg/download?ac cel_key=60%3A1350656196%3Ahttp%253A//www.videolan.org/vlc/download-macosx.html%3 A7233e4e9%245818d66f39b0576e1e9c4a0f3b46b1991180bfdd&click_id=976a88ee-19f7-11e2 -9a21-0200ac1d1d8e&source=accel"
    set dFolder to path to downloads folder
    tell application "Finder" to set newFolder to (make new folder at dFolder) as string
    set f to quoted form of POSIX path of newFolder
    do shell script "cd " & f & " && curl -L " & tUrl & " -o 'vlc.dmg'" -- download  to file "vlc.dmg"
    set downloadedFile to newFolder & "vlc.dmg" --<-- HFS path
    --do something with the downloadedFile

  • How to get the PSComputer name from Get-DnsServerForwarder

    running this command gives me a blank "pscomputername"
    get-dnsserver -cn dc1 | select *
    How to inject the computer name "dc1" into my output string?
    Also, why does running this command yield nothing:
    get-dnsserverforwarder -cn (gc $list) | select ipaddress
    yet this does?
    gsv -cn (gc $list) | select machinename
    Thanks.

    Hi,
    running this command gives me a blank "pscomputername"
    get-dnsserver -cn dc1 | select *
    How to inject the computer name "dc1" into my output string?
    $computerName = 'DC1'
    Get-DnsServer -ComputerName $computerName |
    Select *,@{N='ComputerName';E={$computerName}}
    EDIT: That's a calculated property:
    http://technet.microsoft.com/en-us/library/ff730948.aspx
    EDIT2: Just to nitpick - you don't have an 'output string', you have an output object. Remember, PowerShell is all about objects.
    Also, why does running this command yield nothing:
    get-dnsserverforwarder -cn (gc $list) | select ipaddress
    yet this does?
    gsv -cn (gc $list) | select machinename
    You may need to add -ExpandProperty to Select-Object, but I can't test that.
    Don't retire TechNet! -
    (Don't give up yet - 12,950+ strong and growing)

  • How to get the instance name from the SWFLoader?

    Hi Guys,
    I am new to Flex. i need help from u.
    i load the swf file through the SWFLoader in Flex 3.
    Than how to get the instace(button,text,etc.,) of the loaded
    swf.
    Please help me.

    Yes. hashcode is not absolutely unique. I know this.
    I had took this idea into my consideration. But it failed finally.
    Thanks
    To JN_.
    Maybe I still have some misunderstood descripte my question.
    neither the name not an "instance name" nor an "object name".
    So now, I really do not know how to call this.
    Can you tell me? Then I will not make the same fault next time.
    thanks.

  • How do I get the directory name from my program?

    Hi,
    I want to indentify the directory name where my executable is running from the program.
    Is there any API similar to GetCurrentDirectory in Windows.
    Thanks,
    Ram

    I think you may be looking for the getcwd(3C) call.
    That call will get you the current working directory
    for your process. See the man page for details (man
    getcwd).
    Alan
    Sun Developer Technical Support
    http://www.sun.com/developers/support

  • Urgent Please regarding how to get the correct name from it,

    I have asome input values say {a=1,b=2,c=3,d=4} in bag A .Now I need to display the name "a" in one column of the table and its value "1" in another column in a jTable so can some one help me out as I have to turn in the stuff tomorrow.
    Thanks in advance.

    I have asome input values say {a=1,b=2,c=3,d=4} in
    bag A .Now I need to display the name "a" in one
    column of the table and its value "1" in another
    column in a jTable so can some one help me out as I
    have to turn in the stuff tomorrow.
    Thanks in advance.Looks like you have spent too much time in the pub! The only way you will get this done is if someone does it for you. Since your specification is so poor (you don't say what form your bag takes) I suspect nobody will even attempt to do it for you.
    Cut your losses. Go back to the pub and accept that you will fail this particular assignment.
    P.S. Start the next assignment in plenty of time.
    P.P.S. Marking something as 'urgent' is normally counter productive.

Maybe you are looking for

  • CS3 + win 8

    Hello, I have CS3 from several years ago that I still use. I recently got a new latop (win 8). I was able to install it through dicks and get it to work just fine, but after 30 days the license disappeared and can't be activated... what do i do? than

  • UnknownHostException AS2

    Hi Experts, I am connecting PI 7.1 and 4PL External system using AS2 adapter, I am getting the below error : 13 16:15:26     Error     Message could not be forwarded to the JCA adapter. Reason: Fatal exception: javax.resource.ResourceException: SEEBU

  • DW CS3 Classroom in a book

    I just purchased DW CS3 and the subject book. I've gone through the first four lessons and I'm finding errors on the book. Some thing just don't work in DW the way the book instructs me to do things. I'm finding errors in typing too. Most I can work

  • What are the document upload limits?

    I have placed five document upload sections on a FormsCentral form that I have created. Are my customers going to encounter any problems with built in limits that do not allow more than one or three documents to be uploaded for a single form?

  • 5.1 mixdown, individual tracks 10 kb in size, not playing

    Folks, CS6, after converting a stereo track to 5.1 surround, am exporting the mixdown along with all tracks. While the mixdown is OK, the 6 tracks are just few KBs in size and aren't playing. What am I missing? Pls advice. Regards, Jay