Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
prisma-core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Descartes Research
prisma-core
Commits
9af107fb
Commit
9af107fb
authored
8 years ago
by
Simon Spinner
Browse files
Options
Downloads
Patches
Plain Diff
Update to new notification definitions.
parent
32e9a0e8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools.descartes.prisma.core/src/tools/descartes/prisma/core/scopes/PhysicalInfrastructureScope.java
+12
-36
12 additions, 36 deletions
...artes/prisma/core/scopes/PhysicalInfrastructureScope.java
with
12 additions
and
36 deletions
tools.descartes.prisma.core/src/tools/descartes/prisma/core/scopes/PhysicalInfrastructureScope.java
+
12
−
36
View file @
9af107fb
...
...
@@ -2,7 +2,6 @@ package tools.descartes.prisma.core.scopes;
import
java.util.List
;
import
org.eclipse.emf.ecore.EObject
;
import
org.eclipse.emf.ecore.resource.Resource
;
import
edu.kit.ipd.descartes.mm.resourcelandscape.ComputeNode
;
...
...
@@ -98,10 +97,18 @@ public class PhysicalInfrastructureScope extends InfrastructureScope {
@Override
protected
void
createMessageExchanges
()
{
super
.
createMessageExchanges
();
getMessageBus
().
createExchange
(
getComputeNodeExchange
(),
ExchangeType
.
DIRECT
);
getMessageBus
().
createExchange
(
getStorageNodeExchange
(),
ExchangeType
.
DIRECT
);
getMessageBus
().
createExchange
(
getHypervisorExchange
(),
ExchangeType
.
DIRECT
);
declareNotification
(
new
NotificationDefinition
(
ComputeNode
.
class
,
getComputeNodeExchange
(),
ExchangeType
.
DIRECT
));
declareNotification
(
new
NotificationDefinition
(
StorageNode
.
class
,
getStorageNodeExchange
(),
ExchangeType
.
DIRECT
));
declareNotification
(
new
NotificationDefinition
(
RuntimeEnvironment
.
class
,
getHypervisorExchange
(),
ExchangeType
.
DIRECT
)
{
@Override
public
boolean
isActive
(
Object
o
)
{
if
(
super
.
isActive
(
o
))
{
return
((
RuntimeEnvironment
)
o
).
getOfClass
()
==
RuntimeEnvironmentClasses
.
HYPERVISOR
;
}
return
false
;
}
});
// Add a queue for delegation of hypervisors to other scopes.
String
hypervisorQueueName
=
getHypervisorExchange
()
+
".Delegation"
;
...
...
@@ -110,35 +117,4 @@ public class PhysicalInfrastructureScope extends InfrastructureScope {
getMessageBus
().
addMessageListener
(
hypervisorQueueName
,
new
DelegationListener
());
}
@Override
public
void
sendNotifications
(
String
notificationType
,
EObject
object
)
{
if
(
object
instanceof
ComputeNode
)
{
sendComputeNodeNotification
(
notificationType
,
(
ComputeNode
)
object
);
}
if
(
object
instanceof
StorageNode
)
{
sendStorageNodeNotification
(
notificationType
,
(
StorageNode
)
object
);
}
if
(
object
instanceof
RuntimeEnvironment
)
{
RuntimeEnvironment
env
=
(
RuntimeEnvironment
)
object
;
if
(
env
.
getOfClass
()
==
RuntimeEnvironmentClasses
.
HYPERVISOR
)
{
sendHypervisorNotification
(
notificationType
,
(
RuntimeEnvironment
)
object
);
}
}
}
private
void
sendComputeNodeNotification
(
String
notificationType
,
ComputeNode
node
)
{
sendNotificationMessage
(
getComputeNodeExchange
(),
node
.
getName
(),
new
ModelNotification
(
getModelRepository
(),
notificationType
,
ComputeNode
.
class
,
node
));
}
private
void
sendStorageNodeNotification
(
String
notificationType
,
StorageNode
node
)
{
sendNotificationMessage
(
getStorageNodeExchange
(),
node
.
getName
(),
new
ModelNotification
(
getModelRepository
(),
notificationType
,
StorageNode
.
class
,
node
));
}
private
void
sendHypervisorNotification
(
String
notificationType
,
RuntimeEnvironment
node
)
{
sendNotificationMessage
(
getStorageNodeExchange
(),
node
.
getName
(),
new
ModelNotification
(
getModelRepository
(),
notificationType
,
RuntimeEnvironment
.
class
,
node
));
}
}
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