This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public List<Admin> getAllAdminsWithPagination(int page, int recordePerPage) { | |
session = HibernateUtil.getSessionFactory().getCurrentSession(); | |
Transaction tr = null; | |
try { | |
tr = session.beginTransaction(); | |
Criteria cr = session.createCriteria(Admin.class); | |
cr.setFirstResult((page - 1) * recordePerPage); | |
cr.setMaxResults(recordePerPage); | |
List<Admin> adminAll = cr.list(); | |
tr.commit(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Rest web service for operate the admin details | |
* | |
* @author dinuka | |
* | |
*/ | |
@Path("/" + APINames.ADMIN) | |
@Api(value = "/" + APINames.ADMIN, description = "Rest api for do operations on admin", produces = MediaType.APPLICATION_JSON) | |
@Produces({ MediaType.APPLICATION_JSON }) | |
public class AdminAPI { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
/** | |
* Simple ArrayList Implementation for Java Beginners | |
* | |
* @author malalanayake | |
* | |
*/ | |
public class ArrayList { | |
private Object[] data; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Currency; | |
/** | |
* LinkList implementation with generics | |
* | |
* @author malalanayake | |
* | |
* @param <T> | |
*/ | |
public class LinkedListWithGenerics<T> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
activemq.uri = tcp://localhost:61616 | |
activemq.username = admin | |
activemq.password = admin | |
queue_name = sample_queue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spring.profiles.active=default,dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package camel.routing.config; | |
import java.util.Arrays; | |
import java.util.List; | |
import org.apache.camel.builder.RouteBuilder; | |
import org.apache.camel.spring.javaconfig.CamelConfiguration; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package camel.routing.processor; | |
import org.apache.camel.Exchange; | |
import org.apache.camel.Processor; | |
import org.apache.log4j.Logger; | |
import org.springframework.stereotype.Component; | |
import com.codahale.metrics.Meter; | |
import camel.routing.monitor.Monitor; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package sample.design.single.responsibility.bad; | |
/** | |
* | |
* Distibution under GNU GENERAL PUBLIC LICENSE Version 2, June 1991 | |
* | |
* @author dmalalan | |
* @created Apr 11, 2016 11:20:19 AM | |
* | |
* @blog https://malalanayake.wordpress.com/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package sample.design.single.responsibility.good; | |
/** | |
* | |
* Distibution under GNU GENERAL PUBLIC LICENSE Version 2, June 1991 | |
* | |
* @author dmalalan | |
* @created Apr 11, 2016 11:20:19 AM | |
* | |
* @blog https://malalanayake.wordpress.com/ |
OlderNewer