Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FUCoin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DistributedSystems4Students
FUCoin
Commits
8da179f4
Unverified
Commit
8da179f4
authored
8 years ago
by
David Bohn
Browse files
Options
Downloads
Patches
Plain Diff
Some minor changes to make the IDE happy
parent
ce4bc8bb
No related branches found
Branches containing commit
No related tags found
1 merge request
!5
Configuration system
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/fucoin/configurations/AbstractConfiguration.java
+6
-8
6 additions, 8 deletions
...ain/java/fucoin/configurations/AbstractConfiguration.java
src/main/java/fucoin/configurations/DefaultConfiguration.java
+0
-1
0 additions, 1 deletion
...main/java/fucoin/configurations/DefaultConfiguration.java
with
6 additions
and
9 deletions
src/main/java/fucoin/configurations/AbstractConfiguration.java
+
6
−
8
View file @
8da179f4
...
...
@@ -23,11 +23,11 @@ import java.util.concurrent.ThreadLocalRandom;
*/
public
abstract
class
AbstractConfiguration
extends
AbstractNode
{
pr
otec
te
d
ActorRef
superVisor
;
pr
iva
te
ActorRef
superVisor
;
pr
otec
te
d
final
List
<
ActorRef
>
activeActors
=
new
ArrayList
<>();
pr
iva
te
final
List
<
ActorRef
>
activeActors
=
new
ArrayList
<>();
pr
otec
te
d
Timeout
timeout
=
new
Timeout
(
Duration
.
create
(
10
,
"seconds"
));
pr
iva
te
Timeout
timeout
=
new
Timeout
(
Duration
.
create
(
10
,
"seconds"
));
public
static
Props
props
(
Class
configurationClass
)
{
...
...
@@ -38,7 +38,7 @@ public abstract class AbstractConfiguration extends AbstractNode {
* Spawns a new wallet and blocks until it has received its initial money
* @throws Exception on timeout
*/
public
ActorRef
spawnWallet
(
String
name
,
boolean
createGUI
)
throws
Exception
{
ActorRef
spawnWallet
(
String
name
,
boolean
createGUI
)
throws
Exception
{
Future
<
Object
>
future
=
Patterns
.
ask
(
superVisor
,
new
ActionAnnounceWalletCreation
(
1
,
self
()),
timeout
);
ActorRef
wallet
=
createWallet
(
name
,
createGUI
);
Await
.
result
(
future
,
timeout
.
duration
());
...
...
@@ -48,7 +48,7 @@ public abstract class AbstractConfiguration extends AbstractNode {
/**
* Creates a wallet without blocking until the wallet was created
*/
p
ublic
ActorRef
createWallet
(
String
name
,
boolean
createGUI
)
{
p
rivate
ActorRef
createWallet
(
String
name
,
boolean
createGUI
)
{
Props
props
;
int
numOfWallets
=
activeActors
.
size
();
if
(
numOfWallets
==
0
)
{
...
...
@@ -83,7 +83,6 @@ public abstract class AbstractConfiguration extends AbstractNode {
/**
* Fetch a random wallet
* @return
*/
public
ActorRef
getRandomWallet
()
{
return
activeActors
.
get
(
ThreadLocalRandom
.
current
().
nextInt
(
activeActors
.
size
()));
...
...
@@ -95,9 +94,8 @@ public abstract class AbstractConfiguration extends AbstractNode {
/**
* Create the supervisor node
* @return
*/
public
ActorRef
initSupervisor
()
{
ActorRef
initSupervisor
()
{
superVisor
=
context
().
actorOf
(
SuperVisorImpl
.
props
(),
"SuperVisorImpl"
);
// Don't ask.
...
...
This diff is collapsed.
Click to expand it.
src/main/java/fucoin/configurations/DefaultConfiguration.java
+
0
−
1
View file @
8da179f4
package
fucoin.configurations
;
import
akka.actor.ActorRef
;
import
fucoin.actions.Action
;
import
fucoin.actions.control.ActionWalletSendMoney
;
import
fucoin.actions.transaction.ActionNotifyObserver
;
import
fucoin.configurations.internal.ConfigurationName
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment