Skip to content

Commit ac061b9

Browse files
author
Yoann Vernageau
committed
add a method skeleton for dynamic analysis of classes (OSGi)
1 parent 3cce145 commit ac061b9

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

commons-core/src/main/java/fr/inria/atlanmod/commons/service/OSGiContext.java

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ private class OSGiServiceDefinition<S> implements ServiceDefinition<S> {
9393
* The service reference.
9494
*/
9595
@Nonnull
96-
private final ServiceReference<S> serviceReference;
96+
private final ServiceReference<S> reference;
9797

9898
/**
9999
* The on-demand service.
@@ -104,18 +104,26 @@ private class OSGiServiceDefinition<S> implements ServiceDefinition<S> {
104104
/**
105105
* Constructs a new {@code OSGiServiceDefinition}.
106106
*
107-
* @param serviceReference the service reference
107+
* @param reference the service reference
108108
*/
109-
public OSGiServiceDefinition(ServiceReference<S> serviceReference) {
110-
this.serviceReference = serviceReference;
111-
this.service = Lazy.with(() -> context.getService(this.serviceReference));
109+
public OSGiServiceDefinition(ServiceReference<S> reference) {
110+
this.reference = reference;
111+
this.service = Lazy.with(() -> context.getService(this.reference));
112112
}
113113

114114
@Nonnull
115115
@Override
116116
@SuppressWarnings("unchecked")
117117
public Class<? extends S> type() {
118118
return (Class<? extends S>) get().getClass();
119+
120+
// try {
121+
// final String className = String[].class.cast(reference.getProperty("objectClass"))[0];
122+
// return (Class<? extends S>) reference.getBundle().loadClass(className);
123+
// }
124+
// catch (ClassNotFoundException e) {
125+
// throw Throwables.shouldNeverHappen(e);
126+
// }
119127
}
120128

121129
@Nonnull

0 commit comments

Comments
 (0)