Solved

Basic Question: Dynamic Java Classloading

Posted on 2010-11-13
4
444 Views
Last Modified: 2012-05-10
Hi there,

i have a basic question, because i'm a java beginner:
Im working on a web project and my servlet needs to access some data from some "information-provider".
I want to write my servlet independend to the information-provider so i'm building a "info-bridge" bean which implements an interface.

I want to use an XML file, where i can configure what "info-bridge" java bean should be used (a bit like the spring-bean config stuff).

So i have the following XML:
<config>
  <information-interface class="myJavaPackage.myProject.bridges.provider1Bridge" />
<config>

What is the best way to load the class from my servlet? Is it Java Reflection or is there any other technique (because i read that java reflection is not very fast) or is there maybe any built-in feature of apache tomcat? What is common??


thx for your help and best regards
manuel
0
Comment
Question by:mesX
  • 2
4 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 250 total points
ID: 34127287
Reflection is fine - you shouldn't have to load the class very often anyway
0
 
LVL 92

Assisted Solution

by:objects
objects earned 250 total points
ID: 34129006
0
 

Author Closing Comment

by:mesX
ID: 34134289
Thx for your quick responses and Tips!


regards!
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 34134984
:)
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
eclipse shortcuts 9 55
web services creation SOAP vs REST 5 41
MySQL  on Tomcat 8 46
Tomcat: Unable to run tomcat service. 2 20
This article is about some of the basic and important steps to be used to improve the performance in web-sphere commerce application development. 1) Always leverage the Dyna-caching facility provided by the product 2) Remove the unwanted code …
There are numerous questions about how to setup an IBM HTTP Server to be administered from WebSphere Application Server administrative console. I do hope this article will wrap things up and become a reference for this task. You need three things…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question