osgi

Looking for basic example of using Apache Felix in dynamic loading of Jar file and instancing a class at runtime in Java

丶灬走出姿态 提交于 2019-12-03 15:34:21
I tried implementing my own class loader based on some examples. However, I think it is not working as expected ( unable to reload Jar file etc. I see few references of recommending using OSGI or Apache Felix for handling Jar file loading. Is there any examples of loading Jar, instancing a class from the Jar? More details on what I am trying to accomplish..I have a Java command line application that essentially continuously runs. I want it to be able to reference JAR files dynamically at runtime and at run-time instance a class in these jars. These jars may contain 1 or more supporting classes

Why is Sun inventing another module system when everyone has standardised on OSGi?

一笑奈何 提交于 2019-12-03 14:48:43
问题 Sun is putting a lot of effort behind modularising the JDK in the form of Jigsaw, and insinuating that it should be the module format of choice for other Java developers as well. The only notable player who is using this is NetBeans (and derivative applications). On the other hand, the industry has standardised around OSGi, with all of the major application vendors basing their runtimes on the module platform, even Sun's own Glassfish. There's even a port of NetBeans to use OSGi as the module

Can't get SWT Display on Mac OS X

你离开我真会死。 提交于 2019-12-03 14:38:02
问题 I'm running Mac OS X Snow Leopard and wan't to access the Display from the activator in an OSGi bundle. Below is the start method for my activator: @Override public void start(BundleContext context) throws Exception { ExecutorService service = Executors.newSingleThreadExecutor(); service.execute(new Runnable() { @Override public void run() { Display display = Display.getDefault(); Shell shell = new Shell(display); Text helloText = new Text(shell, SWT.CENTER); helloText.setText("Hello SWT!");

Sharing a configuration file between OSGi bundles in Apache Servicemix 4?

依然范特西╮ 提交于 2019-12-03 14:09:10
问题 Has anyone been able to successfully share configuration between two or more bundles in SMX4? What I'm looking for is this: Have a single file in $SMX_HOME/etc/myconfiguration.cfg Have this configuration be "available" to be injected into my bundles via the OSGi Configuration Admin using Spring dm, i.e. <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:osgi="http://www.springframework.org/schema/osgi" xmlns:osgix="http://www

What is the best way of grouping OSGi bundles to make a coherent 'application'

六眼飞鱼酱① 提交于 2019-12-03 12:34:30
The "OSGi way" is to develop separate bundles containing discrete, coherent pieces of functionality. Sometimes these bundles contain utility classes, sometimes they depend on utility classes and set up their own OSGi Services. Users, on the other hand, are unlikely to be exposed to bundles. They care more about the application , a piece of software that performs a task or solves their problem. Normally an application will use multiple bundles (say, imported via Import-Package) to perform its tasks. What is the best way to formalise this relationship in the OSGi world? One example requirement

Best way to convert existing java projects to osgi bundles

丶灬走出姿态 提交于 2019-12-03 12:31:13
We have lot of components out of which we want to modularize only a few to start with. Wondering what is the best way (in the context of my build environment) to create bundles out of all these components? My environment: Java 6, Maven 2.2.1, Hudson Technologies: Spring 3.0.5, WebSphere 7, Hibernate 3.2.x and most of apache commons. Requirements Modularize only few components. Rest of the components can export all of the packages. When imported into eclipse, I should be able to see the bundles of imported-packages as dependencies in build path (mvn eclipse:eclipse doesn't seem to do this)

OSGi Threading Model

ぐ巨炮叔叔 提交于 2019-12-03 12:07:26
I have searched the Internet but failed to find a satisfactory answer. What is the threading model present in an OSGi container? Does it simply spawn a new thread to each registered bundle e.g.? Any reference regarding the threading model would be great. You have not found anything because there is no such thing as an "OSGi threading model". Bundles simply exist and don't "have threads" unless they start them. The OSGi framework follows a synchronous model, ie. everything happens in a strict order. Bundles are not executed in threads (but they have their own classloader instances). There are

Large Enterprise Java Application - Modularization

[亡魂溺海] 提交于 2019-12-03 12:00:30
问题 I work for a country-wide company, so the software we develop is large scale. Our core system is Web based including webservices . We are currently redesigning the entire project and is moment to start the project structure. We have like 7 web modules including for the web project based on Struts2 and Spring 3.1 . A Webservice core based on JAX-WS and Spring 3.1 My question is what are the best practices to design the project structure and modularization for a project like this: We'll

Does OSGI JNDI allow coexistence with JNDI calls from non-OSGI code?

无人久伴 提交于 2019-12-03 11:47:09
问题 Chapter 126 of the OSGI Enterprise Release 5 specification mentions compatibility: "Support the traditional JNDI programming model used by Java SE and Java EE clients." and use of OSGI-unaware code: "Clients and JNDI Context providers that are unaware of OSGi use static methods to connect to the JRE JNDI implementation. The InitialContext class provides access to a Context from a provider and providers use the static NamingManager methods to do object conversion and find URL Contexts. This

What's new in OSGi 4.2?

青春壹個敷衍的年華 提交于 2019-12-03 11:31:46
OSGi 4.2 has just been released which updates the 4.1 specification with a few new RFCs. So, what's particularly new with OSGi 4.2, which frameworks support 4.2 already (or are close to) and why should you target new developments against a 4.2 framework instead of a 4.1? In most cases, a point release of OSGi (such as 4.1->4.2) doesn't really change much existing behaviour, so it's safe to say that if you have an app that depends on 4.1, it'll run on 4.2 without problem. What is new is that a few items have been standardised which should enable for better interoperability between different