Solved

Example of modular Java code for non-web applications

Posted on 2010-09-13
2
656 Views
Last Modified: 2012-05-10
Greetings,

I'm looking for an example of simple modular code in Java. After quite some researching, I'm only finding complex examples and "full" packages which also utilize larger frameworks and such. It seems like there would be a much simpler solution.

I'm assuming some usage of reflection and such. The modules don't need security considerations; they will only be provided and written by in-house developers. The reflection and interfacing is cake, but what I'm largely confused about is how to get the classes loaded dynamically at run-time when the JAR files may be dropped in place at any time.
0
Comment
Question by:michael_martinek
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
jatyap earned 250 total points
ID: 33668599
Since you mention that the JAR files can be dropped in place, I'm assuming you want to have something similar to how the Eclipse IDE handles their plugins?

Well, first off, you will need to specify a directory (or group of directories) which your application will treat as a plugin/dropin repository.

I'm not sure if this is what you want, but the following link shows how to load classes from JAR files at runtime. You can also call invoke on the methods, etc. (Basically whatever you can do with reflection)

http://www.javaworld.com/javaworld/javatips/jw-javatip70.html
0
 

Author Closing Comment

by:michael_martinek
ID: 33668685
Exactly it. Thanks!
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

687 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