Commit graph

157 commits

Author SHA1 Message Date
Roland
64b523638e rework childrenRefs to make context.stop(child) fully asynchronous
- replace TreeMap with custom ChildrenContainer, which has three
  implementations: empty, normal and “terminating” (i.e. waiting for
  some child to terminate)
- split recreate() in the same way as terminate(), so that there is a
  phase during which the suspended actor waits for termination of all
  children which were stopped in preRestart
- do not null out “actor” in ActorCell during restart, because we do
  need the supervisionStrategy and nulling it out does not buy us much
  in this case anyway
- provide new ActorContext.suspendForChildTermination(), which enters
  limbo for as long there are outstanding termination requests; this
  enables code which is very similar to previously (half-working) setups
  with “synchronous” context.stop(child)

docs are still missing, plus a little polishing here and there; oh, and
before I forget: ActorCell NOW is 64 bytes again ;-)
2012-02-29 21:10:31 +01:00
Roland
dca309c535 incorporate Patrik’s feedback
- rename to DynamicAccess
- rename to createInstanceFor / createClassFor
- fix a few little things
2012-02-10 11:36:23 +01:00
Roland
2ce47d6bb5 Bye-bye ReflectiveAccess, introducing PropertyMaster, see #1750
- PropertyMaster is the only place in Akka which calls
  ClassLoader.getClass (apart from kernel, which might be special)
- all PropertyMaster methods (there are only three) take a ClassManifest
  of what is to be constructed, and they verify that the obtained object
  is actually compatible with the required type

Other stuff:
- noticed that I had forgotten to change to ExtendedActorSystem when
  constructing Extensions by ExtensionKey (damn you, reflection!)
- moved Serializer.currentSystem into JavaSerializer, because that’s the
  only one needing it (it’s only used in readResolve() methods)
- Serializers are constructed now with one-arg constructor taking
  ExtendedActorSystem (if that exists, otherwise no-arg as before), to
  allow JavaSerializer to do its magic; possibly necessary for others as
  well
- Removed all Option[ClassLoader] signatures
- made it so that the ActorSystem will try context class loader, then
  the class loader which loaded the class actually calling into
  ActorSystem.apply, then the loader which loaded ActorSystemImpl
- for the second of the above I added a (reflectively accessed hopefully
  safe) facility for getting caller Class[_] objects by using
  sun.reflect.Reflection; this is optional an defaults to None, e.g. on
  Android, which means that getting the caller’s classloader is done on
  a best effort basis (there’s nothing we can do because a StackTrace
  does not contain actual Class[_] objects).
- refactored DurableMailbox to contain the owner val and use that
  instead of declaring that in all subclasses
2012-02-09 11:56:43 +01:00
Roland
45140b465e Merge remote-tracking branch 'origin/master' into wip-1644-programmatic-deploy-∂π 2012-02-03 09:49:04 +01:00
Roland
c699c3d32d include review comments
- rename NoScope -> NoScopeGiven
- add scaladoc for scopes
- add some return types
2012-02-03 09:43:23 +01:00
Roland
76bba1f530 remote deploy docs & provider.getExternalAddressFor (see #1765) 2012-02-03 09:16:18 +01:00
Roland
10974acfe8 make it possible to programmatically deploy (e.g. remotely), see #1644
- add Deploy to Props, which is used as the basis (overridden by
  configuration)
- utilize general mechanism .withFallback (introduced on Deploy,
  RouterConfig and Scope)
- actually pass Props over the wire when deploying remotely in order to
  retain settings (this was an oversight before)
- write tests for the new functionality
2012-02-01 15:19:51 +01:00
Viktor Klang
3363a6984d Remove that shit 2012-02-01 11:39:04 +01:00
Jonas Bonér
0fa184560c Moved Gossiper, FailureDetector and VectorClock (with tests) to the akka-cluster module. Deleted all old unused cluster code (ZooKeeper-based stuff).
Signed-off-by: Jonas Bonér <jonas@jonasboner.com>
2012-01-31 13:34:06 +01:00
Jonas Bonér
f914dfe83b Merged with master.
Signed-off-by: Jonas Bonér <jonas@jonasboner.com>
2012-01-31 13:34:06 +01:00
Roland
4fb0858e55 remote cleanup: include feedback from Viktor and Patrik
- re-label Client/Server to Inbound/Outbound for netty settings
  description
- move to just using exactly one class loader for all reflective
  activities of the ActorSystem, which is either the context class
  loader or the one which loaded the ActorSystem’s class; document that
  putting Akka on boot class path will not work
- be more careful with initializing the Client- and ServerBootstrap
- rename Port to DesiredPortFromConfig to discourage misuse
- write test for NettySettings
- various small fixes
2012-01-30 11:57:24 +01:00
Roland
ac1ee9ae91 rework use of ClassLoaders, see #1736 2012-01-27 14:21:54 +01:00
Roland
c5fc153a10 rework system initialization, remove remote address from LocalActorRef
- move all creation of ActorRefs into the ActorRefProvider (deadLetters,
  locker)
- rootPath does not contain remote transport address any longer in order
  to start the LocalActorRefProvider before the RemoteTransport; the
  transport address is inserted during serialization only, which enables
  us later to have more than one transport available for one actor
  system (maybe even needed for clustering)
- fix inheritance between DeadLetterActorRef and EmptyLocalActorRef
- document some start-up dependencies by reordering constructor code
- fix remote tests which used self.path for identifying remote actors
  (since that no longer includes the remote transport address)
2012-01-27 12:14:28 +01:00
Roland
52d6e5625d Merge remote-tracking branch 'origin/master' into wip-1685-remote-cleaup-∂π 2012-01-26 11:24:23 +01:00
Viktor Klang
1590438b0c Removing dead imports from akka-remote 2012-01-25 15:55:27 +01:00
Roland
34a0f005b1 Merge branch 'master' into wip-1581-patterns-ask 2012-01-20 19:29:17 +01:00
Roland
020c6b61da move all Ask stuff to akka.pattern
- remove ?(msg, timeout), should always use ?(msg)(timeout) because of
  Scala’s only Martin-acknowledged design flaw of being able to pass
  tuples into single-arg methods without adding another pair of parens
- put a provider into all actor refs, because they all are created by
  and associated with one
- treat all terminated refs equally: tell(msg) and return broken promise
2012-01-20 15:45:53 +01:00
Roland
edceda8edf restructure remoting
- remove Remote, incorporate its few fields into RemoteActorRefProvider
- rename RemoteSupport to RemoteTransport to sync up with conf and
  the way we talk about it
- remove LocalAddress/RemoteAddress etc. and just have a final case
  class Address(protocol, system, host, port)
- split netty settings out or RemoteSettings into NettySettings
- split out from NettyRemoteSupport.scala: Server.scala, Client.scala,
  Settings.scala

plus a few fixes, including using the contextClassLoader when loading
the provider for ActorSystemImpl
2012-01-20 14:41:15 +01:00
Viktor Klang
149fbea5a7 Updating Copyright as per #1660 2012-01-19 18:21:06 +01:00
Roland
1daaee98aa Merge remote-tracking branch 'origin/master' into wip-1581-patterns-ask 2012-01-18 14:20:13 +01:00
Roland
00ec3f89dc move ask machinery from ActorRefProvider to pattern.AskSupport
- now everything is assembled in one spot
- also moved PromiseActorRef and AskTimeoutException from akka.actor
- plus a little boy-scouting
2012-01-18 11:53:45 +01:00
Roland
9c762dec20 polish “ask” pattern, see #1581
- move package objects into their respective package.scala file in the
  right directories
- make implicit conversion as well as explicit facility available under
  the same name akka.patterns.ask for easy import
- revert the logic to produce the Promise for the PromiseActorRef within
  the ActorRefProvider; supporting wrapping of external Promises does
  not seem to justify doing needless extra allocations in case of
  failure
- add scaladocs
- factor out “def provider” into trait ActorRefWithProvider, as it
  didn’t feel right attaching this information “by exception” to
  MinimalActorRef
2012-01-17 17:35:33 +01:00
Viktor Klang
bfd11ad8c5 Removing nodename 2012-01-17 15:25:26 +01:00
Patrik Nordwall
f01b9486aa Removed create-as and corresponding ActorRecipe. See #1511 2012-01-17 14:27:51 +01:00
Viktor Klang
5106fd6d4d Removing ClusterName 2012-01-17 11:40:26 +01:00
Roland
255a8c74e9 include actor system’s address in akkaSource log property, see #1621 2012-01-12 13:29:37 +01:00
Nikolay Botev
4270b6f71b ask 2.1 2012-01-01 22:23:10 -08:00
Nikolay Botev
a44da38e2b ask-2.0 2012-01-01 22:23:08 -08:00
Viktor Klang
5d2bd2492f Switching to using OrderedMemoryAware executor same for all of the remoting, added more remote config tests and switched to mem size conf 2011-12-30 12:04:20 +01:00
Roland
0ed6a67e08 Remote DeathWatch (2): make it work
- introduce EmptyLocalActorRef, which is returned for unsuccessful
  look-ups of local scope
- this fixes the problem that actors—after their death—can still be
  looked up without losing their identity; otherwise behave like
  DeadLetterActorRef
- adapt tests accordingly
- make DeathWatchSpec reusable and build remote test from it
- remove several unused imports of LocalActorRef
- use LocalRef/RemoteRef in pattern matches where applicable: these are
  marker traits for a ref’s scope; InternalActorRef mandates a scope as
  per its self-type
2011-12-29 16:27:32 +01:00
Roland
5e0ed18056 Remote DeathWatch (1): daemon communication 2011-12-26 18:23:55 +01:00
Jonas Bonér
a18206b81a Merge branch 'wip-remove-timeout-jboner' into master
Signed-off-by: Jonas Bonér <jonas@jonasboner.com>
2011-12-14 22:46:43 +01:00
Viktor Klang
e959493e12 Enormous merge with master which probably led to the indirect unfortunate deaths of several kittens 2011-12-14 17:36:39 +01:00
Jonas Bonér
04cd2adee9 Moved Timeout classes from akka.actor._ to akka.util._.
Signed-off-by: Jonas Bonér <jonas@jonasboner.com>
2011-12-14 17:34:56 +01:00
Roland
92e7693203 Merge remote-tracking branch 'origin/master' into wip-remote-supervision-rk 2011-12-13 16:59:43 +01:00
Roland
db7dd9450c re-enable the missing three multi-jvm tests
- mostly a matter of putting correct target.nodes URIs into configs and
  adding withRouting to Props
- ScatterGather test was wrong to assume equal distribution of replies
  from connections; it is random and only the sum should add up
2011-12-13 10:58:09 +01:00
Viktor Klang
bf01045779 Merged with current master 2011-12-13 10:18:15 +01:00
Roland
d1a26a9e28 implement remote routers
- split out actual routing functionality into *Like traits to be
  reusable
- make RemoteRouterConfig which only differs in how remote placement is
  initiated
- teach RemoteDeployer how to convert local RouterConfig in case config
  key “target.nodes” is set
- IT WORKS! All tests GREEN
- oh, yeah, had to make ActorPath serializable ...
2011-12-13 01:29:05 +01:00
Roland
0a7e5fe296 wrap up local routing
- pull some more generic stuff out of the individual routers, add
  factories which take only target lists
- add router parsing to Deployer, removing everything which is not
  strictly related to local scope, which left only few things, so move
  them to Deployer.scala and delete DeploymentConfig
- fix ConfiguredLocalRoutingSpec to use the new configuration mechanism
  and verify that configuration overrides code
- fix DeployerSpec by using (mostly) correct lookup paths and removing
  everything which was not local
- change config file layout, removing everything which is not local from
  akka-actor/.../reference.conf, putting the remote stuff into the
  akka-remote/.../reference.conf (unused as of yet); adapt comments
  according to changed functionality
2011-12-12 23:34:52 +01:00
Viktor Klang
b32cbbc764 Renaming Block to Await, renaming sync to result, renaming on to ready, Await.ready and Await.result looks and reads well 2011-12-12 22:50:08 +01:00
Viktor Klang
2d418c188f Renaming completeWithResult to success, completeWithException to failure, adding tryComplete to signal whether the completion was made or not 2011-12-12 17:25:34 +01:00
Roland
d8bc57dc17 Merge remote-tracking branch 'origin/1428-RoutedActorRef-henrikengstrom' into wip-remote-supervision-rk 2011-12-12 15:58:23 +01:00
Henrik Engstrom
192f84df71 Misc improvements of ActorRoutedRef. Implemented a scatterer gatherer router. Enabled router related tests. See #1440. 2011-12-12 15:06:40 +01:00
Roland
7f0275bca2 that was one hell of a FIXME
- fixed so that netty pipeline when generating addresses does not need
  to know the system name of the connecting client (which might differ
  from the local one, of course)
- this entailed differentiating between transport addresses and system
  addresses, which I took as an opportunity to separate everything out
  properly so that address schemas can easily be made pluggable
- made RemoteSupport generic in the address format it supports
- adapt netty stuff, and made everything else work with the most
  generic: ParsedTransportAddress
- did I mention that I statically separated unparsed from parsed
  addresses?
2011-12-11 20:00:26 +01:00
Viktor Klang
de758c0cc1 Adding Blockable.sync to reduce usage of resultOrException.get 2011-12-11 01:29:46 +01:00
Viktor Klang
3b1330c6d7 Tests are green with new Futures, consider this a half-way-there marker 2011-12-11 00:40:52 +01:00
Roland
09aadcb60d incorporate review comments
- add two missing @volatiles
- add quite some comments
- refactor provider.actorOf to always take a path for the child, not
  only a name
2011-12-10 20:32:23 +01:00
Henrik Engstrom
fd7a041c09 merged 2011-12-10 12:58:34 +01:00
Henrik Engstrom
11450ca4e0 tmp 2011-12-10 10:53:38 +01:00
Roland
4f643eaa1b simplify structure of Deployer
- remove unused ActorDeployer trait
- put everything in one class with simple initialization structure and
  one protected method to override for adaptations
- adapt RemoteDeployer accordingly
- change “remote” key to directly contain the single remote address,
  since there is nothing else to configure
- adapt test cases accordingly
2011-12-09 20:19:59 +01:00