Skip to content

Migrate simple local stateless EJB 2.1 to Spring Boot #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
fabapp2 opened this issue Mar 29, 2022 · 0 comments
Open

Migrate simple local stateless EJB 2.1 to Spring Boot #61

fabapp2 opened this issue Mar 29, 2022 · 0 comments

Comments

@fabapp2
Copy link
Contributor

fabapp2 commented Mar 29, 2022

Depends-on #62

What needs to be done

Provide a recipe to migrate a simple EJB 2.1 to Spring Boot.

Why it needs to be done

Acceptance Criteria

Given

<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar id="ejb-jar_1" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd" version="2.1">
   <description>Example of a session bean</description>
   <display-name>MyTimeBeanEJBName</display-name>
   <enterprise-beans>
      <session id="Session_MyTime">
         <description>An EJB named MyTimeBean</description>
         <display-name>MyTimeBeanName</display-name>
         <ejb-name>TheTimeBean</ejb-name>
         <local-home>mytimepak.MyTimeLocalHome</local-home>
         <local>mytimepak.MyTimeLocal</local>
         <ejb-class>mytimepak.MyTimeBean</ejb-class>
         <session-type>Stateless</session-type>
         <transaction-type>Container</transaction-type>
      </session>
   </enterprise-beans>
</ejb-jar>
package mytimepak;
public class MyTimeBean implements javax.ejb.SessionBean {

	public void ejbCreate() {}
	public void ejbActivate() {}
   	public void ejbPassivate() {}
   	public void setSessionContext(javax.ejb.SessionContext ctx) {}
   	public void unsetSessionContext() {}
   	public void ejbRemove() {}

	public String getTime() {
		String s = new java.util.Date().toString();
		return s;
	}
}

Expected

package mytimepak;

import ...springframework..Service;
import ...springframework..Transactional;

/**
* An EJB named MyTimeBean
*/
@Service("TheTimeBean")
@Transactional
public class MyTimeBean {

	public String getTime() {
		String s = new java.util.Date().toString();
		return s;
	}
}

Additional Information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant