Skip to content

Instantly share code, notes, and snippets.

@ericacm
ericacm / oauth2_jpa_provider.scala
Created July 2, 2011 13:11
Security OAuth 2 Provider and JPA Domain Classes
class ProviderTokenServices(dataSource: DataSource) extends JdbcOAuth2ProviderTokenServices(dataSource) with InitializingBean {
var log: Logger = LoggerFactory.getLogger(this.getClass.getName)
@Autowired var domainManager: DomainManager = _
@Autowired var schedulerService: SchedulerService = _
@Value("${providerTokenServices.pruneSchedule:0 0 12 * * *}")
var pruneSchedule: String = _
override def storeAccessToken(token: OAuth2AccessToken, authentication: OAuth2Authentication[_ <: Authentication, _ <: Authentication]) {
@momania
momania / gist:858476
Created March 7, 2011 13:05
Akka AMQP Loadbalance
import akka.amqp.AMQP._
import akka.amqp._
import akka.actor._
import java.util.concurrent.{TimeUnit, CountDownLatch}
import util.Random
object LoadBalancingDemo {
def main(args: Array[String]) {