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
| myModule.service('state', | |
| function () { | |
| /** The global/shared modules state (filled in modules.run) **/ | |
| this.global = {}; | |
| /** | |
| * Initializes the scope state. If the scope state is already initialized and kept from previous invocation, | |
| * the scope is initialized using the previous state. If the scope state doesn't exist, the scope is initialized | |
| * using the initFunc. |
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
| // web.xml | |
| <!-- Atmosphere servlet --> | |
| <servlet> | |
| <servlet-name>async</servlet-name> | |
| <servlet-class>org.atmosphere.cpr.MeteorServlet</servlet-class> | |
| <init-param> | |
| <param-name>org.atmosphere.servlet</param-name> | |
| <param-value>org.springframework.web.servlet.DispatcherServlet</param-value> | |
| </init-param> |
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 com.blogspot.lifeinide.async.service | |
| import org.apache.commons.lang3.StringUtils; | |
| import org.atmosphere.cpr.*; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.security.core.context.SecurityContext; | |
| import org.springframework.security.web.context.HttpSessionSecurityContextRepository; | |
| import org.springframework.stereotype.Service; |
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
| /** | |
| * Creates new reference manager | |
| * @constructor | |
| */ | |
| function Reference() { | |
| function RefHolder() { | |
| this.assignFunc = []; | |
| } |
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
| /** | |
| * Creates new reference manager | |
| * @param {function(object)} idFunc returning string representing unique ID of object | |
| * @constructor | |
| */ | |
| function Reference(idFunc) { | |
| this.idFunc = idFunc; | |
| function RefHolder(id) { | |
| this.id = id; |
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 com.blogspot.lifeinide.postgres.locks; | |
| import org.hibernate.SessionFactory; | |
| import org.hibernate.exception.LockAcquisitionException; | |
| import org.hibernate.jdbc.Work; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.stereotype.Service; | |
| import org.springframework.transaction.annotation.Transactional; |
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 com.blogspot.lifeinide.postgres.locks; | |
| import org.aspectj.lang.ProceedingJoinPoint; | |
| import org.aspectj.lang.annotation.Around; | |
| import org.aspectj.lang.annotation.Aspect; | |
| import org.hibernate.exception.LockAcquisitionException; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import org.springframework.core.Ordered; | |
| import org.springframework.stereotype.Component; |
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
| @Entity | |
| @Inheritance(strategy = InheritanceType.SINGLE_TABLE) | |
| @DiscriminatorColumn(name = BaseEnity.DISCRIMINATOR_COLUMN, discriminatorType = DiscriminatorType.STRING, length = 255) | |
| public class Company extends BaseEnity { | |
| protected String name; | |
| @OneToMany(mappedBy = "company") | |
| @Cascade(CascadeType.ALL) | |
| protected List<Department> departments = new ArrayList<Department>(); |
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
| @Entity | |
| @Inheritance(strategy = InheritanceType.SINGLE_TABLE) | |
| @DiscriminatorColumn(name = BaseEnity.DISCRIMINATOR_COLUMN, discriminatorType = DiscriminatorType.STRING, length = 255) | |
| public class Department extends BaseEnity { | |
| @ManyToOne | |
| protected Company company; | |
| protected String name; |
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 class MockCompanyDataSet { | |
| protected int idx = 10; | |
| public Object next() { | |
| if (idx--==0) // stop iteration on 10 objects | |
| return null; | |
| Company company = PojoHelper.createCompany("Mock "); | |
| company.setId(10-idx); |
OlderNewer