Posts

Showing posts from 2014

JBoss AS 7.1.1 and HornetQ Clustering in two nodes

Fist follow
https://docs.jboss.org/author/display/AS71/AS7+Cluster+Howto

Check the  domain.xml configuration in the Master node  ( for profile - full-ha part) for the things marked yellow

Code as well as the domain.xml configuration  and the ports to be open is in GitHub https://github.com/alexcpn/jboss_hornetq_clustering

(Tested with AS 7.1.1)

Invocation

http://:8330/MroControllerREST/rest/sessionbean/startmro?scopename=werwerwe
http://:8330/MroControllerREST/rest/sessionbean/startmro?scopename=werwerwe

Will create a message/messages and send to MROQueue ; The MROExecutorMDB will receive it and post a message to MROTopic which will be received by MROControllerMDB in both the master and slave nodes

(Deploy MROController.ear and MROExecuotor.ear to only other-server-group (jboss-cli.sh , connect to master and deploy)


Exposing REST interface from a Session Bean

Here is a working example  at https://github.com/alexcpn/rest_in_sessionbean Tested with JBOSS AS 7.1.1. Note that a war file is needed in the ear, with a web.xml . This is using JBOSS inbuilt RESTEasy.

Idea from Adam Bein's  blog - www.adam-bien.com/roller/abien/entry/ejb_3_1_and_rest

Apache CXF and Spring

http://cxf.apache.org/docs/writing-a-service-with-spring.html http://cxf.apache.org/docs/jax-ws-configuration.html http://cxf.apache.org/docs/configuration.html
And finally àhttp://stackoverflow.com/questions/689902/cxf-without-spring --> http://cxf.apache.org/docs/servlet-transport.html#ServletTransport-UsingtheservlettransportwithoutSpring
Follwing maven settings injroller http://www.jroller.com/gmazza/entry/web_service_tutorial
Reading a little from Spring I understood that this is actually the applicationcontext.xml and cxf is somehow cooking its beans with Spring


< bean id="cxf" class="org.apache.cxf.bus.spring.SpringBus" destroy-method="shutdown" / >     < bean id="org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor"                 class="org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor" / >     < bean id="org.apache.cxf.bus.spring.Jsr250BeanPostProcessor"                 class="org.apach…

JavaScript (Prototypal) Inheritance with new and Object.create

//--------------------------- //Inheritance in JavaScript //--------------------------- var Person = function (string){ this.name= string; //if ( !(this instanceof Person) ) //part soln to danger 1 // return new Person(name); }; Person.prototype.get_name = function(){ return this.name; }; //Danger 1 : No compile errors here if new is skipped //Also inside the function would now be the global this object, //not the new instance! The constructor would be overriding all sorts //of global variables inadvertently var manu = Person("Manu"); name; manu.get_name(); //Danger 1 :only run time error here;Crackford's reason var adi = new Person("Adi"); adi.get_name(); //Okay let us try Iheritance with new var Employee = function (name,company){ this.name = name; this.company=company; Person.call(this,name); }; Employee.prototype.get_company = function(){ return this.comany; }; //How to inherit from Person ? //Step 1 - Link the prototypes …