Removed trailing whitespace
This commit is contained in:
parent
a06f1ffb7b
commit
3687b6f6e4
134 changed files with 939 additions and 940 deletions
|
|
@ -1 +1 @@
|
|||
se.scalablesolutions.akka.rest.ListWriter
|
||||
se.scalablesolutions.akka.rest.ListWriter
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import se.scalablesolutions.akka.actor.Actor
|
|||
|
||||
class ActorComponentProvider(val clazz: Class[_], val configurators: List[Configurator])
|
||||
extends IoCFullyManagedComponentProvider with Logging {
|
||||
|
||||
|
||||
override def getScope = ComponentScope.Singleton
|
||||
|
||||
override def getInstance: AnyRef = {
|
||||
|
|
@ -26,4 +26,4 @@ class ActorComponentProvider(val clazz: Class[_], val configurators: List[Config
|
|||
"No Actor or Active Object for class [" + clazz + "] could be found.\nMake sure you have defined and configured the class as an Active Object or Actor in a supervisor hierarchy.")
|
||||
else instances.head.asInstanceOf[AnyRef]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,15 +9,15 @@ import se.scalablesolutions.akka.actor.Actor._
|
|||
|
||||
class AkkaBroadcaster extends org.atmosphere.jersey.JerseyBroadcaster {
|
||||
name = classOf[AkkaBroadcaster].getName
|
||||
|
||||
|
||||
val caster = actor { case f : Function0[_] => f() }
|
||||
|
||||
override def destroy {
|
||||
super.destroy
|
||||
caster.stop
|
||||
}
|
||||
|
||||
|
||||
protected override def broadcast(r : AtmosphereResource[_,_], e : AtmosphereResourceEvent[_,_]) = {
|
||||
caster ! (() => super.broadcast(r,e))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* Copyright (C) 2009-2010 Scalable Solutions AB <http://scalablesolutions.se>
|
||||
*/
|
||||
|
||||
|
||||
package se.scalablesolutions.akka.comet
|
||||
|
||||
import se.scalablesolutions.akka.actor.Actor
|
||||
|
|
@ -24,8 +24,8 @@ class AkkaClusterBroadcastFilter extends Actor with ClusterBroadcastFilter[AnyRe
|
|||
@BeanProperty var clusterName = ""
|
||||
@BeanProperty var broadcaster : Broadcaster = null
|
||||
|
||||
/**
|
||||
* Stops the actor
|
||||
/**
|
||||
* Stops the actor
|
||||
*/
|
||||
def destroy: Unit = self.stop
|
||||
|
||||
|
|
@ -36,14 +36,14 @@ class AkkaClusterBroadcastFilter extends Actor with ClusterBroadcastFilter[AnyRe
|
|||
*/
|
||||
def filter(o : AnyRef) = new BroadcastFilter.BroadcastAction(o match {
|
||||
case ClusterCometBroadcast(_,m) => m //Do not re-broadcast, just unbox and pass along
|
||||
|
||||
|
||||
case m : AnyRef => { //Relay message to the cluster and pass along
|
||||
Cluster.relayMessage(classOf[AkkaClusterBroadcastFilter],ClusterCometBroadcast(clusterName,m))
|
||||
m
|
||||
}
|
||||
})
|
||||
|
||||
def receive = {
|
||||
def receive = {
|
||||
//Only handle messages intended for this particular instance
|
||||
case b @ ClusterCometBroadcast(c, _) if (c == clusterName) && (broadcaster ne null) => broadcaster broadcast b
|
||||
case _ =>
|
||||
|
|
@ -51,4 +51,4 @@ class AkkaClusterBroadcastFilter extends Actor with ClusterBroadcastFilter[AnyRe
|
|||
|
||||
//Since this class is instantiated by Atmosphere, we need to make sure it's started
|
||||
self.start
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ class AkkaServlet extends org.atmosphere.cpr.AtmosphereServlet with Logging {
|
|||
*/
|
||||
override def createCometSupportResolver() : CometSupportResolver = {
|
||||
import scala.collection.JavaConversions._
|
||||
|
||||
|
||||
new DefaultCometSupportResolver(config) {
|
||||
type CS = CometSupport[_ <: AtmosphereResource[_,_]]
|
||||
override def resolveMultipleNativeSupportConflict(available : JList[Class[_ <: CS]]) : CS = {
|
||||
|
|
@ -70,7 +70,7 @@ class AkkaServlet extends org.atmosphere.cpr.AtmosphereServlet with Logging {
|
|||
case _ => super.resolveMultipleNativeSupportConflict(available)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override def resolve(useNativeIfPossible : Boolean, useBlockingAsDefault : Boolean) : CS = {
|
||||
val predef = config.getInitParameter("cometSupport")
|
||||
if (testClassExists(predef)) newCometSupport(predef)
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class AkkaLoader extends Logging {
|
|||
@volatile private var hasBooted = false
|
||||
|
||||
@volatile private var _bundles: Option[Bootable] = None
|
||||
|
||||
|
||||
def bundles = _bundles;
|
||||
|
||||
/*
|
||||
|
|
@ -58,4 +58,4 @@ class AkkaLoader extends Logging {
|
|||
log.info(" Running version %s", Config.VERSION)
|
||||
log.info("==============================")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,4 +30,4 @@ class AkkaServlet extends ServletContainer {
|
|||
|
||||
webApplication.initiate(resourceConfig, new ActorComponentProviderFactory(configurators))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import se.scalablesolutions.akka.config.Config
|
|||
import se.scalablesolutions.akka.util.{Logging, Bootable}
|
||||
|
||||
import javax.servlet.{ServletContextListener, ServletContextEvent}
|
||||
|
||||
|
||||
/**
|
||||
* This class can be added to web.xml mappings as a listener to start and shutdown Akka.
|
||||
*
|
||||
|
|
@ -22,13 +22,13 @@ import javax.servlet.{ServletContextListener, ServletContextEvent}
|
|||
* </listener>
|
||||
* ...
|
||||
*</web-app>
|
||||
*/
|
||||
*/
|
||||
class Initializer extends ServletContextListener {
|
||||
lazy val loader = new AkkaLoader
|
||||
|
||||
def contextDestroyed(e: ServletContextEvent): Unit =
|
||||
|
||||
def contextDestroyed(e: ServletContextEvent): Unit =
|
||||
loader.shutdown
|
||||
|
||||
def contextInitialized(e: ServletContextEvent): Unit =
|
||||
|
||||
def contextInitialized(e: ServletContextEvent): Unit =
|
||||
loader.boot(true, new BootableActorLoaderService with BootableRemoteActorService with CamelService)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ class AkkaSecurityFilterFactory extends ResourceFilterFactory with Logging {
|
|||
if (auth == "N/A") throw new IllegalStateException("The config option 'akka.rest.authenticator' is not defined in 'akka.conf'")
|
||||
auth
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Currently we always take the first, since there usually should be at most one authentication actor, but a round-robin
|
||||
* strategy could be implemented in the future
|
||||
|
|
@ -410,7 +410,7 @@ trait SpnegoAuthenticationActor extends AuthenticationActor[SpnegoCredentials] w
|
|||
/**
|
||||
* keytab location with credentials for the service principal
|
||||
*/
|
||||
lazy val keyTabLocation = {
|
||||
lazy val keyTabLocation = {
|
||||
val p = Config.config.getString("akka.rest.kerberos.keyTabLocation", "N/A")
|
||||
if (p == "N/A") throw new IllegalStateException("The config option 'akka.rest.kerberos.keyTabLocation' is not defined in 'akka.conf'")
|
||||
p
|
||||
|
|
|
|||
|
|
@ -12,4 +12,4 @@ object AllTest extends TestCase {
|
|||
}
|
||||
|
||||
def main(args: Array[String]) = junit.textui.TestRunner.run(suite)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ object BasicAuthenticatorSpec {
|
|||
class BasicAuthenticatorSpec extends junit.framework.TestCase
|
||||
with Suite with MockitoSugar with MustMatchers {
|
||||
import BasicAuthenticatorSpec._
|
||||
|
||||
|
||||
val authenticator = actorOf[BasicAuthenticator]
|
||||
authenticator.start
|
||||
|
||||
|
|
@ -57,13 +57,13 @@ class BasicAuthenticatorSpec extends junit.framework.TestCase
|
|||
val result: AnyRef = (authenticator !! (Authenticate(req, List("chef")), 10000)).get
|
||||
|
||||
result must be(OK)
|
||||
// the authenticator must have set a security context
|
||||
// the authenticator must have set a security context
|
||||
verify(req).setSecurityContext(any[SecurityContext])
|
||||
}
|
||||
|
||||
@Test def testUnauthorized = {
|
||||
val req = mock[ContainerRequest]
|
||||
|
||||
|
||||
// fake a basic auth header -> this will authenticate the user
|
||||
when(req.getHeaderValue("Authorization")).thenReturn("Basic " + new String(Base64.encode("foo:bar")))
|
||||
when(req.isUserInRole("chef")).thenReturn(false) // this will deny access
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue