Giter VIP home page Giter VIP logo

domino's People

Contributors

atooni avatar helgoboss avatar lefou avatar lreszka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

domino's Issues

Bundle Activator does not implement BundleActivator (Sample App with SBT)

I suppose I'm missing something or missing everything... but I do not see how an end user application should be built. In particular, I miss a sample application which shows how things are wired together.

I'm doing a small proof of concept involving SBT, sbt-osgi and Domino.
Needless to say that I have a build.sbt, not a pom.xml.

My Activator cannot be processed properly by BND (which is wired in the build by sbt-osgi) with a message that my class does not extend BundleActivator, but I know it does.

MyDominoActivator (services.internal)
+-- DominoActivator (domino)
    +-- OsgiContext (domino)
        +-- EmptyBundleActivator (domino)
            +-- BundleActivator (org.osgi.framework)

This is a snippet showing how BND complains:

> services/osgiBundle
[info] Updating {file:/home/rgomes/workspace/alpha1/}services...
[info] Resolving jline#jline;2.12.1 ...
[info] Done updating.
[info] Compiling 1 Scala source to /home/rgomes/workspace/alpha1/services/target/scala-2.11/classes...
[error] bnd: The Bundle Activator services.internal.MyDominoActivator does not implement BundleActivator.

If I create a bundle in the usual way, extending BundleActivator, it works just fine: BND likes it and Karaf can activate the bundle as it should be.

I suppose I'm missing something... or doing something really stupid. Or both.
Could you please give some help during these baby steps?

Thanks a lot.

Add more documentation to README

Migrate the documentation from the separate website to the README. I suggest to use the Asciidoctor format. We could still serve a rendered version via gh-pages branch.

Bulk API to provide and consume services

Domino has a very nice type-safe syntax to consume and provide services. But the way, the API is designed, it is only possible to work with types known beforehand (compile time).

In case, were one needs to use generic collections of dependencies (their types), the Domino API (1.0.0) cannot be used, as variables can not be used in type parameter position.

Please add some API to work with generic dependency collections. Also a API to register a generic set of services would be helpful.

Example for dependencies not known at compile time:

// val services = Seq(classOf[ServiceA], classOf[ServiceB])
whenServicesPresent(services) { depsMap: Map[Class[_], Any] =>
  val serviceA = depsMap(classOf[serviceA])
  val serviceB = depsMap(classOf[serviceB])
}

Are there any rules for Capsule ordering of start ?

I have a:

class OsgiCapsule extends Capsule {

which is added in a DominoActivator

  whenBundleActive {

    val m = new OsgiCapsule()
    addCapsule(m)

I found the start on OsgiCapsule gets called immediately when I added it on addCapsule, Is that the rule?

UnsupportedOperationException on container shutdown

Looks like some wrapped Java Collection does not support the remove operation.

java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)
Scala 2.10.6
Domino 1.1.1

g! stop 0
g! java.lang.UnsupportedOperationException: remove
        at scala.collection.convert.Wrappers$MapWrapper$$anon$1$$anon$5.remove(Wrappers.scala:206)
        at java.util.AbstractCollection.clear(Unknown Source)
        at java.util.AbstractMap.clear(Unknown Source)
        at org.apache.ftpserver.impl.DefaultFtpServerContext.dispose(DefaultFtpServerContext.java:198)
        at org.apache.ftpserver.impl.DefaultFtpServer.stop(DefaultFtpServer.java:126)
        at de.woq.XXX.sib.ftpserver.internal.FtpServerLifecycle.destroy(FtpServerLifecycle.java:87)
        at de.woq.XXX.sib.ftpserver.internal.FTPServerActivator$$anonfun$1$$anonfun$apply$mcV$sp$1$$anonfun$apply$2$$anonfun$apply$1.apply$mcV$sp(FTPServerActivator.scala:103)
        at domino.capsule.CapsuleConvenience$$anon$2.stop(CapsuleConvenience.scala:38)
        at domino.capsule.DefaultCapsuleScope$$anonfun$stop$1.apply(DefaultCapsuleScope.scala:11)
        at domino.capsule.DefaultCapsuleScope$$anonfun$stop$1.apply(DefaultCapsuleScope.scala:11)
        at scala.collection.mutable.HashSet.foreach(HashSet.scala:79)
        at domino.capsule.DefaultCapsuleScope.stop(DefaultCapsuleScope.scala:11)
        at domino.service_watching.ServiceWatching$$anonfun$whenAdvancedServicePresent$1$$anonfun$apply$1.apply(ServiceWatching.scala:96)
        at domino.service_watching.ServiceWatching$$anonfun$whenAdvancedServicePresent$1$$anonfun$apply$1.apply(ServiceWatching.scala:93)
        at scala.Option.foreach(Option.scala:236)
        at domino.service_watching.ServiceWatching$$anonfun$whenAdvancedServicePresent$1.apply(ServiceWatching.scala:93)
        at domino.service_watching.ServiceWatching$$anonfun$whenAdvancedServicePresent$1.apply(ServiceWatching.scala:80)
        at domino.service_watching.ServiceWatcherCapsule$$anon$1.removedService(ServiceWatcherCapsule.scala:46)
        at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:956)
        at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:864)
        at org.osgi.util.tracker.AbstractTracked.untrack(AbstractTracked.java:341)
        at org.osgi.util.tracker.ServiceTracker.close(ServiceTracker.java:375)
        at domino.service_watching.ServiceWatcherCapsule.stop(ServiceWatcherCapsule.scala:56)
        at domino.capsule.DefaultCapsuleScope$$anonfun$stop$1.apply(DefaultCapsuleScope.scala:11)
        at domino.capsule.DefaultCapsuleScope$$anonfun$stop$1.apply(DefaultCapsuleScope.scala:11)
        at scala.collection.mutable.HashSet.foreach(HashSet.scala:79)
        at domino.capsule.DefaultCapsuleScope.stop(DefaultCapsuleScope.scala:11)
        at domino.configuration_watching.ConfigurationWatcherCapsule$$anonfun$stop$1.apply(ConfigurationWatcherCapsule.scala:74)
        at domino.configuration_watching.ConfigurationWatcherCapsule$$anonfun$stop$1.apply(ConfigurationWatcherCapsule.scala:74)
        at scala.Option.foreach(Option.scala:236)
        at domino.configuration_watching.ConfigurationWatcherCapsule.stop(ConfigurationWatcherCapsule.scala:74)
        at domino.capsule.DefaultCapsuleScope$$anonfun$stop$1.apply(DefaultCapsuleScope.scala:11)
        at domino.capsule.DefaultCapsuleScope$$anonfun$stop$1.apply(DefaultCapsuleScope.scala:11)
        at scala.collection.mutable.HashSet.foreach(HashSet.scala:79)
        at domino.capsule.DefaultCapsuleScope.stop(DefaultCapsuleScope.scala:11)
        at domino.OsgiContext$$anonfun$stop$1.apply(OsgiContext.scala:67)
        at domino.OsgiContext$$anonfun$stop$1.apply(OsgiContext.scala:66)
        at scala.Option.foreach(Option.scala:236)
        at domino.OsgiContext$class.stop(OsgiContext.scala:66)
        at domino.DominoActivator.stop(DominoActivator.scala:66)
        at org.apache.felix.framework.util.SecureAction.stopActivator(SecureAction.java:719)
        at org.apache.felix.framework.Felix.stopBundle(Felix.java:2604)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1383)
        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
        at java.lang.Thread.run(Unknown Source)
java.lang.UnsupportedOperationException: remove
        at scala.collection.convert.Wrappers$MapWrapper$$anon$1$$anon$5.remove(Wrappers.scala:206)
        at java.util.AbstractCollection.clear(Unknown Source)
        at java.util.AbstractMap.clear(Unknown Source)
        at org.apache.ftpserver.impl.DefaultFtpServerContext.dispose(DefaultFtpServerContext.java:198)
        at org.apache.ftpserver.impl.DefaultFtpServer.stop(DefaultFtpServer.java:126)
        at de.woq.XXX.sib.ftpserver.internal.FtpServerLifecycle.destroy(FtpServerLifecycle.java:87)
        at de.woq.XXX.sib.ftpserver.internal.FTPServerActivator$$anonfun$1$$anonfun$apply$mcV$sp$1$$anonfun$apply$2$$anonfun$apply$1.apply$mcV$sp(FTPServerActivator.scala:103)
        at domino.capsule.CapsuleConvenience$$anon$2.stop(CapsuleConvenience.scala:38)
        at domino.capsule.DefaultCapsuleScope$$anonfun$stop$1.apply(DefaultCapsuleScope.scala:11)
        at domino.capsule.DefaultCapsuleScope$$anonfun$stop$1.apply(DefaultCapsuleScope.scala:11)
        at scala.collection.mutable.HashSet.foreach(HashSet.scala:79)
        at domino.capsule.DefaultCapsuleScope.stop(DefaultCapsuleScope.scala:11)
        at domino.service_watching.ServiceWatching$$anonfun$whenAdvancedServicePresent$1$$anonfun$apply$1.apply(ServiceWatching.scala:96)
        at domino.service_watching.ServiceWatching$$anonfun$whenAdvancedServicePresent$1$$anonfun$apply$1.apply(ServiceWatching.scala:93)
        at scala.Option.foreach(Option.scala:236)
        at domino.service_watching.ServiceWatching$$anonfun$whenAdvancedServicePresent$1.apply(ServiceWatching.scala:93)
        at domino.service_watching.ServiceWatching$$anonfun$whenAdvancedServicePresent$1.apply(ServiceWatching.scala:80)
        at domino.service_watching.ServiceWatcherCapsule$$anon$1.removedService(ServiceWatcherCapsule.scala:46)
        at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:956)
        at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:864)
        at org.osgi.util.tracker.AbstractTracked.untrack(AbstractTracked.java:341)
        at org.osgi.util.tracker.ServiceTracker.close(ServiceTracker.java:375)
        at domino.service_watching.ServiceWatcherCapsule.stop(ServiceWatcherCapsule.scala:56)
        at domino.capsule.DefaultCapsuleScope$$anonfun$stop$1.apply(DefaultCapsuleScope.scala:11)
        at domino.capsule.DefaultCapsuleScope$$anonfun$stop$1.apply(DefaultCapsuleScope.scala:11)
        at scala.collection.mutable.HashSet.foreach(HashSet.scala:79)
        at domino.capsule.DefaultCapsuleScope.stop(DefaultCapsuleScope.scala:11)
        at domino.configuration_watching.ConfigurationWatcherCapsule$$anonfun$stop$1.apply(ConfigurationWatcherCapsule.scala:74)
        at domino.configuration_watching.ConfigurationWatcherCapsule$$anonfun$stop$1.apply(ConfigurationWatcherCapsule.scala:74)
        at scala.Option.foreach(Option.scala:236)
        at domino.configuration_watching.ConfigurationWatcherCapsule.stop(ConfigurationWatcherCapsule.scala:74)
        at domino.capsule.DefaultCapsuleScope$$anonfun$stop$1.apply(DefaultCapsuleScope.scala:11)
        at domino.capsule.DefaultCapsuleScope$$anonfun$stop$1.apply(DefaultCapsuleScope.scala:11)
        at scala.collection.mutable.HashSet.foreach(HashSet.scala:79)
        at domino.capsule.DefaultCapsuleScope.stop(DefaultCapsuleScope.scala:11)
        at domino.OsgiContext$$anonfun$stop$1.apply(OsgiContext.scala:67)
        at domino.OsgiContext$$anonfun$stop$1.apply(OsgiContext.scala:66)
        at scala.Option.foreach(Option.scala:236)
        at domino.OsgiContext$class.stop(OsgiContext.scala:66)
        at domino.DominoActivator.stop(DominoActivator.scala:66)
        at org.apache.felix.framework.util.SecureAction.stopActivator(SecureAction.java:719)
        at org.apache.felix.framework.Felix.stopBundle(Felix.java:2604)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1383)
        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
        at java.lang.Thread.run(Unknown Source)
ERROR: Bundle de.woq.XXX.sib.ftpserver [127] Error stopping bundle. (java.lang.UnsupportedOperationException: remove)
ERROR: Bundle de.woq.XXX.sib.ftpserver [127] Error stopping file:/home/lefou/work/woq/XXX-sib-2.0/assembly/de.woq.XXX.sib.blended.shop/target/de.woq.XXX.blended.shop-2.0.12-SNAPSHOT/profiles/XXX-shop/2.0.12-SNAPSHOT/bundles/de.woq.XXX.sib.ftpserver-2.0-SNAPSHOT.jar (org.osgi.framework.BundleException: Activator stop error in bundle de.woq.XXX.sib.ftpserver [127].)

whenConfigurationActive block invoked twice on startup

The function given to whenConfigurationActive is invoked twice during bundle startup, from two different threads:, the second one is always "CM Configuration Updater (ManagedService Update: pid=...])", the first one depends on how the start happens. If it is done through the Karaf console by the user typing bundle:start, it is the "Karaf local console user karaf" thread but during auto-deploy by dropping a new jar in the deploy folder, it is the same "CM Configuration... " thread.

I'm not sure this is a bug or just a inconvenience we have to live with, but it IS inconvenient for sure...

Remove Logging trait from DominoActivator

The Logging trait introduces a public log method and lots of protected vals. It's inherited by DominoActivator but never used anywhere. I've seen many situation, where SLF4J was the preferred logging solution but the inherited log variable name collided with the own logger. Also, the provided logger in not lazily acquired (despite the fact, fallbackLogger is declared lazy) and depends on an early avaliable OSGi LogService.

We loose nothing, if we remove it from DominoActivator. A potential user can still simply mix the trait into the concrete activator class.

What do you think?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.