I've checked the Java API but I can't figure out how to build up a custom 
LoggingBus from scratch that can be passed to a LoggingAdapter instance. 
All the buses implementations do not implement such "interface".

Am I loosing my time or is there any way of achieving it using Java?

Cheers and thanks for the patience!

El jueves, 10 de abril de 2014 11:32:14 UTC+2, Patrik Nordwall escribió:
>
> Use the classes in akka.event.japi.*
> The classes in akka.event.* is the Scala API.
>
> Cheers,
> Patrik
>
>
> On Thu, Apr 10, 2014 at 8:52 AM, Guillermo Szeliga 
> <[email protected]<javascript:>
> > wrote:
>
>> Hi there,
>>
>> I've been trying to tackle this issue on my own but I didn't succeed so 
>> far so I hope you can help. Our new architecture requires to have a whole 
>> different logging event system (independents from Akka's)  by using a 
>> LoggingAdapter instance but with a custom-tailored LogEventBus. The idea is 
>> to have actors that act as subscribers to any loggin event that's been 
>> published on our custom bus so that our own cryptography secured appenders 
>> write out all of these signed traces independently from the ordinary 
>> logging events.
>>
>> Unfortunately we need to work with Java, so my first approach was to 
>> create our custom LogEventBus by extending EventStream, since it's the only 
>> implementation of a LogEventBus that I can see from the Javadocs, something 
>> like this:
>>
>> public class SecureLoggerBus extends EventStream {
>>
>>     /**
>>      * @param debug
>>      */
>>     public SecureLoggerBus(final boolean debug) {
>>         super(debug);
>>     }
>>
>> }
>>
>> Now, if my code is compiled using Eclipse, everything's fine and the 
>> final PoC works just as expected, but if I try to compile the same code via 
>> console, I get the following output:
>>
>> [INFO] BUILD FAILURE
>> [INFO] 
>> ------------------------------------------------------------------------
>> [INFO] Total time: 2.853s
>> [INFO] Finished at: Thu Apr 10 14:25:24 CST 2014
>> [INFO] Final Memory: 13M/154M
>> [INFO] 
>> ------------------------------------------------------------------------
>> [ERROR] Failed to execute goal 
>> org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile 
>> (default-compile) on project akka_lab: Compilation failure
>> [ERROR] 
>> /home/operador/development/workspace_experimental/akka_lab/src/main/java/com/scytl/poc/slogger/SecureLoggerBus.java:[18,7]
>>  
>> subclassification() in akka.event.EventStream cannot implement 
>> subclassification() in akka.event.SubchannelClassification; attempting to 
>> use incompatible return type
>> [ERROR] found   : java.lang.Object
>> [ERROR] required: akka.util.Subclassification<java.lang.Object>
>> [ERROR] -> [Help 1]
>> [ERROR] 
>> [ERROR] To see the full stack trace of the errors, re-run Maven with the 
>> -e switch.
>> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
>> [ERROR] 
>> [ERROR] For more information about the errors and possible solutions, 
>> please read the following articles:
>> [ERROR] [Help 1] 
>> http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
>>
>>
>>
>> Now, If I decide to override subclassification() as being requested with 
>> the proper return type,
>>
>> public class SecureLoggerBus extends EventStream {
>>
>>     /**
>>      * @param debug
>>      */
>>     public SecureLoggerBus(final boolean debug) {
>>         super(debug);
>>     }
>>
>>     /**
>>      * @see akka.event.EventStream#subclassification()
>>      */
>>     @Override
>>     public Subclassification<Object> subclassification() {
>>         return (Subclassification<Object>) super.subclassification();
>>     }
>>
>> }
>>
>>
>> The code compiles but failes at runtime.
>>
>> Exception in thread "main" java.lang.NoSuchMethodError: 
>> akka.event.EventStream.subclassification()Ljava/lang/Object;
>>  at 
>> com.scytl.poc.slogger.SecureLoggerBus.subclassification(SecureLoggerBus.java:33)
>> at 
>> akka.event.SubchannelClassification$class.akka$event$SubchannelClassification$$subscriptions(EventBus.scala:131)
>>  at 
>> akka.event.EventStream.akka$event$SubchannelClassification$$subscriptions$lzycompute(EventStream.scala:26)
>> at 
>> akka.event.EventStream.akka$event$SubchannelClassification$$subscriptions(EventStream.scala:26)
>>  at akka.event.SubchannelClassification$class.publish(EventBus.scala:168)
>> at akka.event.EventStream.publish(EventStream.scala:26)
>>  at akka.event.EventStream.subscribe(EventStream.scala:45)
>> at com.scytl.poc.slogger.main.Main.main(Main.java:38)
>>
>>  I'm currently using Akka 2.3.2.
>>
>> Any ideas? Does it have to do the fact that suclassification is an 
>> implicit val expected somewhere?
>>
>> Any hint will be appreciated. Thanks!
>>  
>> -- 
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
>
> Patrik Nordwall
> Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
> Twitter: @patriknw
> JOIN US. REGISTER TODAY! <http://www.scaladays.org/>
> Scala <http://www.scaladays.org/>
> Days <http://www.scaladays.org/>
> June 16th-18th, <http://www.scaladays.org/>
> Berlin <http://www.scaladays.org/>
>
> 

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to