8
Referencias Bibliograficas
[1] GRONE, B.; KNOPFEL, A.; TABELING, P. Component vs. component:
Why we need more than one definition. In: Proceedings of ECBS’05:
12th IEEE International Conference and Workshops on Engi-
neering of Computer-Based Systems. Washington, DC, USA: IEEE
Computer Society, 2005. p. 550–552. ISBN 0-7695-2308-0. 1
[2] SZYPERSKI, C. Component Software: Beyond Object-Oriented
Programming. Boston, MA, USA: Addison-Wesley Longman Pu-
blishing Co., Inc., 2002. ISBN 0201745720. 1
[3] SZYPERSKI, C. Component technology: what, where, and how? In:
Proceedings of the 25th International Conference on Software
Engineering (ICSE’03). Washington, DC, USA: IEEE Computer
Society, 2003. p. 684–693. ISBN 0-7695-1877-X. 1, 2.2.5, 4.1, 7
[4] EMMERICH, W. Distributed component technologies and their software
engineering implications. In: Proceedings of the 24th International
Conference on Software Engineering (ICSE’02). New York, NY,
USA: ACM, 2002. p. 537–546. ISBN 1-58113-472-X. 1, 2.1, 7
[5] MANCINELLI, F. et al. Managing the complexity of large free and open
source package-based software distributions. In: Proceedings of the
21st IEEE/ACM International Conference on Automated Soft-
ware Engineering (ASE’06). Washington, DC, USA: IEEE Computer
Society, 2006. p. 199–208. ISBN 0-7695-2579-2. 1, 4.1
[6] FLISSI, A. et al. Deploying on the grid with DeployWare. In: Procee-
dings of the 8th International Symposium on Cluster Compu-
ting and the Grid (CCGRID’08). IEEE Computer Society, 2008.
p. 177–184. Disponıvel em: <http://dblp.uni-trier.de/db/conf/
ccgrid/ccgrid2008.html#FlissiDDM08>. (document), 1, 1, 2.3.7,
2.13, 5, 5.5
[7] LACOUR, S.; PeREZ, C.; PRIOL, T. Deploying CORBA components
on a computational grid: General principles and early experiments using
Capıtulo 8. Referencias Bibliograficas 94
the Globus Toolkit. In: Proceedings of the 2nd International Wor-
king Conference on Component Deployment (CD’04). Springer-
Verlag, 2004. (Lecture Notes in Computer Science, 3083), p. 35–49. Dis-
ponıvel em: <http://www.irisa.fr/paris/Biblio/Papers/Lacour/
LacPerPri04CD.pdf>. 1
[8] FOSTER, I. T. The anatomy of the grid: Enabling scalable virtual or-
ganizations. In: Euro-Par ’01: Proceedings of the 7th Internati-
onal Euro-Par Conference on Parallel Processing. London, UK:
Springer-Verlag, 2001. p. 1–4. ISBN 3-540-42495-4. 1
[9] SUN MICROSYSTEMS. Enterprise JavaBeans v3.0. Santa Clara,
USA, maio 2006. Document: JSR/220. 1, 2.3.1, 2.3.1
[10] OBJECT MANAGEMENT GROUP. CORBA Components - Ver-
sion 3.0. Needham, USA, jun. 2002. Document: formal/2002-06-65. 1,
2.3.3, 2.3.3, 2.3.3, 2.3.4, 2.4, 3.1
[11] COULSON, G. et al. A generic component model for building systems
software. ACM Transactions on Computer Systems, ACM, New
York, NY, USA, v. 26, n. 1, p. 1–42, 2008. ISSN 0734-2071. (document),
1, 2.3.2, 2.3, 2.3.2
[12] BRUNETON, E. et al. The FRACTAL component model and its support
in java: Experiences with auto-adaptive and reconfigurable systems.
Software: Practice and Experience, John Wiley & Sons, Inc., New
York, NY, USA, v. 36, n. 11-12, p. 1257–1284, 2006. ISSN 0038-0644. 1,
2.3.7, 2.3.7
[13] DENG, G. et al. DAnCE: A QoS-enabled component deployment and
configuration engine. In: Proceedings of the 3rd Working Confe-
rence on Component Deployment (CD’05). [s.n.], 2005. p. 67–82.
Disponıvel em: <http://citeseerx.ist.psu.edu/viewdoc/summary?
doi=10.1.1.60.36>. (document), 1, 2.3.4, 2.8, 2.3.4
[14] OBJECT MANAGEMENT GROUP. Deployment and Configura-
tion of Component-based Distributed Applications - Version
4.0. Needham, USA, abr. 2006. Document: formal/2006-04-02. 1, 2.3.4,
2.4
[15] FLISSI, A.; MERLE, P. A generic deployment framework for grid com-
puting and distributed applications. In: Proceedings of the 2nd
Capıtulo 8. Referencias Bibliograficas 95
International OTM Symposium on Grid computing, high-
performAnce and Distributed Applications (GADA’06). [S.l.]:
Springer-Verlag, 2006. (Lecture Notes in Computer Science, v. 4279), p.
1402–1411. 1, 2.3.7
[16] MANOLIOS, P.; VROON, D.; SUBRAMANIAN, G. Automating
component-based system assembly. In: Proceedings of ISSTA’07: In-
ternational Symposium on Software Testing and Analysis. New
York, NY, USA: ACM, 2007. p. 61–72. ISBN 978-1-59593-734-6. 1
[17] LACOUR, S.; PEREZ, C.; PRIOL, T. Generic application description
model: toward automatic deployment of applications on computational
grids. The 6th IEEE/ACM International Workshop on Grid
Computing (CCGRID’05), nov. 2005. (document), 1, 2.3.5, 2.9, 2.3.6,
2.4
[18] CUDENNEC, L. CoRDAGe : Un service generique de co-
deploiement et redeploiement d’applications sur grilles. Tese
(These de doctorat) — Universite de Rennes 1, IRISA, Rennes, France,
jan. 2009. 1, 7
[19] MATEVSKA-MEYER, J.; HASSELBRING, W.; REUSSNER, R. H.
Software architecture description supporting component deployment and
system runtime reconfiguration. In: Proceedings of the 9th In-
ternational Workshop on Component-oriented Programming
(WCP’04). [S.l.: s.n.], 2004. 1.1, 7
[20] BATISTA, T. V.; JOOLIA, A.; COULSON, G. Managing dynamic
reconfiguration in component-based systems. In: Proceedings of the
2nd European Workshop Software Architecture (EWSA’05).
[S.l.]: Springer, 2005. (Lecture Notes in Computer Science, v. 3527), p.
1–17. ISBN 3-540-26275-X. 1.1, 2.3.2, 7
[21] HALL, R. S. et al. An architecture for post-development configuration
management in a wide-area network. In: Proceedings of the 17th
International Conference on Distributed Computing Systems
(ICDCS’97). Washington, DC, USA: IEEE Computer Society, 1997.
p. 269. ISBN 0-8186-7813-5. 2.1, 4.1
[22] ARSHAD, N.; HEIMBIGNER, D.; WOLF, A. L. Deployment and dyna-
mic reconfiguration planning for distributed software systems. Software
Quality Control, Kluwer Academic Publishers, Hingham, MA, USA,
v. 15, n. 3, p. 265–281, 2007. ISSN 0963-9314. 2.1
Capıtulo 8. Referencias Bibliograficas 96
[23] COUPAYE, T.; ESTUBLIER, J. Foundations of enterprise software
deployment. In: Proceegins of CSMR’00: Conference on Software
Maintenance and Reengineering. Washington, DC, USA: IEEE
Computer Society, 2000. p. 65–74. ISBN 0-7695-0546-5. 2.1
[24] LAU, K.-K.; WANG, Z. Software component models. IEEE Transacti-
ons on Software Engineering, IEEE Computer Society, Los Alamitos,
CA, USA, v. 33, n. 10, p. 709–724, 2007. ISSN 0098-5589. 2.2.2, 2.2.3,
2, 2.4, 3.3
[25] SUN MICROSYSTEMS. JavaBeans 1.01 Specification. Santa
Clara, USA, ago. 1997. http://java.sun.com/javase/technologies/
desktop/javabeans/docs/spec.html. 2.3.1
[26] SUN MICROSYSTEMS. JMX: Java Management Extensions.
Santa Clara, USA, out. 2006. http://java.sun.com/javase/6/docs/
technotes/guides/jmx/. 2.3.1
[27] OBJECT MANAGEMENT GROUP. Common Object Request
Broker Architecture: Core Specification - Version 2.6. Needham,
USA, dez. 2001. Document: formal/2001-12-01. 2.3.2, 2.3.3, 3
[28] GARLAN, D.; MONROE, R. T.; WILE, D. Acme: Architectural descrip-
tion of component-based systems. In: LEAVENS, G. T.; SITARAMAN,
M. (Ed.). Foundations of Component-Based Systems. [S.l.]: Cam-
bridge University Press, 2000. p. 47. 2.3.2
[29] JOOLIA, A. et al. Mapping adl specifications to an efficient and re-
configurable runtime component platform. In: Proceedings of the
5th Working IEEE/IFIP Conference on Software Architecture
(WICSA’05). Washington, DC, USA: IEEE Computer Society, 2005.
p. 131–140. ISBN 0-7695-2548-2. 2.3.2
[30] OBJECT MANAGEMENT GROUP. Common Object Request
Broker Architecture: Core Specification - Version 3.0. Needham,
USA, dez. 2002. Document: formal/2002-12-06. 2.3.3
[31] WANG, N.; SCHMIDT, D. C.; O’RYAN, C. Overview of the CORBA
Component Model. In: . Component-based Software Engine-
ering: Putting the Pieces Together. Boston, USA: Addison-Wesley
Longman Publishing Co., Inc., 2001. p. 557–571. ISBN 0-201-70485-4.
2.3.3
Capıtulo 8. Referencias Bibliograficas 97
[32] NARDI, A. R. Componentes CORBA. Dissertacao (Mestrado) —
Universidade de Sao Paulo, set. 2003. (document), 2.5, 2.6, 2.3.3
[33] OBJECTWEB. The Open CORBA Component Model Platform.
jul. 2005. Disponıvel em: <http://openccm.objectweb.org>. 2.3.3
[34] BRICLET, F.; CONTRERAS, C.; MERLE, P. OpenCCM : une infras-
tructure a composants pour le deploiement d’applications a base de com-
posants CORBA. In: IMAG/LSR (Ed.). Conf’erence Francophone
sur le D’eploiement et la (Re)Configuration de Logiciels (DE-
COR’04). [s.n.], 2004. (ISBN : 2-7261-1276-5), p. 101–112. Disponıvel
em: <http://hal.archives-ouvertes.fr/hal-00003287/en>. 2.3.3,
2.3.3
[35] SCHMIDT, D. C. CIAO: Component-Integrated ACE ORB.
out. 2006. Disponıvel em: <http://www.dre.vanderbilt.edu/CIAO>.
2.3.3, 2.3.4
[36] KEBBAL, D.; BERNARD, G. Component search service and deploy-
ment of distributed applications. Distributed Objects and Applica-
tions, IEEE Computer Society, Los Alamitos, USA, v. 00, p. 0125, 2001.
2.3.3
[37] OBJECT MANAGEMENT GROUP. CORBA Component Model
Specification - Version 4.0. Needham, EUA, abr. 2006. Document:
formal/2006-04-01. 2.3.4
[38] SCHMIDT, D.; KUHNS, F. An overview of the real-time CORBA
specification. IEEE Computer, v. 33, n. 6, p. 56–63, jun. 2000. ISSN
0018-9162. 2.3.4
[39] SCHMIDT, D. C. TAO: The ACE ORB. jun. 2007. Disponıvel em:
<http://www.dre.vanderbilt.edu/TAO>. 4
[40] PEREZ, C. Contribution a la definition et la mise en oeuvre dun
modele de programmation a base de composants logiciels pour
la programmation des grilles informatiques. France: [s.n.], 2006.
Habilitation a diriger des recherches - Universite de Rennes I. 2.3.5
[41] CUDENNEC, L.; ANTONIU, G.; BOUGe, L. CoRDAGe: towards trans-
parent management of interactions between applications and resources.
In: MICHAEL GERNDT AND JESUS LABARTA AND BARTON MIL-
LER. Proceedings of the International Workshop on Scalable
Capıtulo 8. Referencias Bibliograficas 98
Tools for High-End Computing (STHEC’08). Kos Grece, 2008.
p. 13–24. Disponıvel em: <http://hal.inria.fr/inria-00288339/
en/>. (document), 2.3.6, 2.10, 2.4
[42] AUGUSTO, C. E. L. Uma Infra-Estrutura para a Execucao Dis-
tribuıda de Componentes de Software. Dissertacao (Mestrado) —
PUC-Rio, Brasil, 2008. 3, 3.1, 3.2, 3.3, 4.4, 4.4, 5.7, 6, 6.1, 7
[43] TECGRAF. SCS: Software Component System. nov. 2008. Dis-
ponıvel em: <http://www.tecgraf.puc-rio.br/~scorrea/scs>. 3
[44] BOX, D. Essential COM. Boston, USA: Addison-Wesley Longman
Publishing Co., Inc., 1997. Foreword By-Grady Booch and Foreword
By-Charlie Kindel. ISBN 0201634465. 3.1
[45] IERUSALIMSCHY, R. Programming in Lua. Second edition. [S.l.]:
Lua.org, 2006. ISBN 8590379825. 3.1, 4.2
[46] MAIA, R.; CERQUEIRA, R.; CALHEIROS, R. OiL: An object request
broker in the Lua language. In: Proceedings of SBRC’07 - Salao de
Ferramentas. Porto Alegre, Brazil: SBC, 2006. p. 1439–1446. 3.1, 5.1.2
[47] HOEK, A. van der; WOLF, A. L. Software release management for
component-based software. Software – Practice & Experience, John
Wiley & Sons, Inc., New York, NY, USA, v. 33, n. 1, p. 77–98, 2003. ISSN
0038-0644. 4.1, 4.1, 4.5
[48] HOEK, A. van der et al. Software release management. SIGSOFT
Software Engineering Notes, ACM, New York, NY, USA, v. 22, n. 6,
p. 159–175, 1997. ISSN 0163-5948. 4.1
[49] DEBIAN. Debian policy manual. 2009. http://www.debian.org/
doc/debian-policy/index.html. Ultimo acesso em 06/2009. 4.1, 4.2
[50] BAILEY, E. Maximum RPM. [S.l.]: Red Hat Inc, 2000. 442 p. http:
//www.rpm.org/max-rpm. ISBN 1-888172-78-9. 4.1, 4.2
[51] LEONARD, T. Zero Install Project. jun. 2009. Disponıvel em:
<http://0install.net>. 4.2
[52] DOLSTRA, E. Nix Project. set. 2008. Disponıvel em: <http://www.
nix.org>. 4.2
[53] STANDARD for information technology - portable operating system in-
terface (POSIX). Shell and utilities. IEEE Std 1003.1, 2004 Edition.
Capıtulo 8. Referencias Bibliograficas 99
The Open Group Technical Standard. Base Specifications, Issue
6. Includes IEEE Std 1003.1-2001, IEEE Std 1003.1-2001/Cor
1-2002 and IEEE Std 1003.1-2001/Cor 2-2004. Shell and Utili-
ties, 2004. 4.2
[54] RED HAT. Cygwin Project. jan. 2009. Disponıvel em: <http://www.
redhat.com/services/custom/cygwin>. 4.2
[55] HIETANIEMI, J. CPAN Project. jul. 2009. Disponıvel em: <http:
//www.cpan.org>. 4.2
[56] RUBYGEMS Manuals. 2009. Disponıvel em: <http://www.rubygems.
org>. 4.2
[57] LUAROCKS Project. abr. 2009. Disponıvel em: <http://www.
luarocks.org>. 4.2
[58] LUAROCKS. Rockspec Format. abr. 2009. Disponıvel em: <http:
//www.luarocks.org/en/Rockspec_format>. 4.2.1
[59] APACHE. The Apache ANT Project. jan. 2010. Disponıvel em:
<http://ant.apache.org>. 4.3
[60] IONA TECHNOLOGIES. The corbaloc and corbaname URLs.
[S.l.], ago. 2003. http://www.iona.com/devcenter/corba/corbaloc.
pdf. 5.1
[61] FONSECA, E. Monitorando o Ambiente de Execucao de Com-
ponentes de Software Distribuıdos. Dissertacao (Mestrado) — Pon-
tifıcia Universidade Catolica do Rio de Janeiro, Rio de Janeiro, Brasil,
2009. 6, 6.2
[62] DEAN, J.; GHEMAWAT, S. Mapreduce: Simplified data processing
on large clusters. In: Proceedings of OSDI 2004. Berkeley, USA:
USENIX Association, 2004. p. 137–150. (document), 6, 6.2
[63] FONSECA, E.; CORREA, S.; CERQUEIRA, R. Experimenting
middleware-level monitoring facilities to observe component-based ap-
plications. In: Proceedings of SBCARS 2008. Porto Algre, Brasil:
EDIPUCRS, 2008. p. 96–106. ISBN 978-85-7430-786-2. 7
[64] TSENG, T.-L. B. et al. Applying genetic algorithm for the develop-
ment of the components-based embedded system. Computer Stan-
dards & Interfaces, v. 27, n. 6, p. 621 – 635, 2005. ISSN 0920-5489.
Capıtulo 8. Referencias Bibliograficas 100
Disponıvel em: <http://www.sciencedirect.com/science/article/
B6TYV-4F5S6C2-1/2/47d01c7228b5c5fa4f02db5227be3171>. 7
A
Apendice
A.1
IDL do SCS integrado ao LuaRocks
O Codigo A.1 apresenta os tipos de dados usados pelo framework do
SCS e retornado pelos metodos das interfaces basicas do seu modelo de
componentes. O modelo de componentes, por sua vez, possui suas interfaces
ilustradas no Codigo A.2.
Dentre os componentes da infraestrutura de execucao do SCS apenas
o ExecutionNode e Repository sofreram mudancas em suas IDL, que sao
apresentada no Codigo A.4 e A.5, respectivamente. As interfaces usadas pelo
componente do conteiner e apresentada no Codigo A.3.
A.2
IDL dos Descritores Propostos
A integracao com o LuaRocks e o desenvolvimento dos servicos de
implantacao motivaram a criacao de dois descritores: um para indicar a logica
estrutural do componente e outro para indicar os artefatos que o implementam.
O Codigo A.6 apresenta a definicao integral desses descritores.
A.3
IDL dos Servicos para Implantacao
Por fim, o Codigo A.7 apresenta as entidades virtuais que sao mani-
puladas em tempo de planejamento e que existem atraves do uso do servico
DeployManager. Por outro lado, as interfaces dos servicos DeployManager e
Packager sao apresentadas integralmente no Codigo A.8.
A.4
Algoritmos do Mecanismo de Mapeamento Automatico
O mecanismo que permite o mapeamento em mais alto nıvel considerando
nıveis graduais de detalhamento completa o mapeamento dos componentes
na infraestrutura de execucao do SCS e nas maquinas que serao usadas.
O Codigo A.9 apresenta a implementacao do metodo autofit container que
Apendice A. Apendice 102
associa um componente a um conteiner caso o usuario nao tenha especificado
qual conteiner usar no plano de implantacao. O Codigo A.10 apresenta a
implementacao do metodo autofit exnode que associa um conteiner a um
no de execucao caso o usuario nao tenha especificado qual no de execucao
utilizar no plano de implantacao. E, por sua vez, o Codigo A.11 apresenta
a implementacao do metodo autofit host que associa um no de execucao a
uma maquina caso o usuario nao tenha especificado qual maquina utilizar
no plano de implantacao. Esses metodos sao parametrizados pela lista de
implementacoes disponıveis para um dado componente e por restricoes de
linguagem e plataforma. Portanto, caso deseje-se estender, ou mesmo alterar,
a estrategia de mapeamento automatico basta reimplementar esses metodos
que fazem parte da implementacao do servico DeployManager .
Apendice A. Apendice 103
Codigo A.1: Definicao dos tipos usados pela API basica do Modelo de Com-ponentes do SCS1 #i f n d e f SCSDESCS IDL2 #de f i n e SCSDESCS IDL3
4 module s c s {5 module co r e {6 except i on S t a r t u pF a i l e d {} ;7 except i on ShutdownFa i l ed {} ;8 except i on I nva l idName {9 s t r i n g name ;
10 } ;11 except i on I n v a l i dC o nn e c t i o n {} ;12 except i on Al readyConnected {} ;13 except i on ExceededConnec t i onL im i t {} ;14 except i on NoConnect ion {} ;15
16 typede f uns igned long Connec t i on Id ;17 typede f sequence<s t r i n g > NameList ;18
19 s t r u c t Fa c e tD e s c r i p t i o n {20 s t r i n g name ;21 s t r i n g i n t e r f a c e n ame ;22 Object f a c e t r e f ;23 } ;24 typede f sequence<Fac e tDe s c r i p t i o n > Fa c e tD e s c r i p t i o n s ;25
26 s t r u c t Conn e c t i o nDe s c r i p t i o n {27 Connec t i on Id i d ;28 Object o b j r e f ;29 } ;30 typede f sequence<Conne c t i onDe s c r i p t i o n > Conn e c t i o nDe s c r i p t i o n s ;31
32 s t r u c t Re c e p t a c l eD e s c r i p t i o n {33 s t r i n g name ;34 s t r i n g i n t e r f a c e n ame ;35 boolean i s m u l t i p l e x ;36 Conn e c t i o nDe s c r i p t i o n s c onn e c t i o n s ;37 } ;38 typede f sequence<Re c e p t a c l eDe s c r i p t i o n > Re c e p t a c l eD e s c r i p t i o n s ;39
40 s t r u c t ComponentId {41 s t r i n g name ;42 octe t ma j o r v e r s i o n ;43 octe t mi n o r v e r s i o n ;44 octe t p a t c h v e r s i o n ;45 } ;46 typede f sequence<ComponentId> ComponentIdSeq ;47 } ;48 } ;49 #end i f
Apendice A. Apendice 104
Codigo A.2: Interfaces do Modelo de Componentes do SCS1 #in c l u d e ” s c s d e s c s . i d l ”2
3 module s c s { module co r e {4 i n t e r f a c e IComponent {5 vo id s t a r t u p ( ) r a i s e s ( S t a r t u pF a i l e d ) ;6 vo id shutdown ( ) r a i s e s ( ShutdownFa i l ed ) ;7
8 Object ge tFace t ( i n s t r i n g f a c e t i n t e r f a c e ) ;9 Object getFacetByName ( i n s t r i n g f a c e t ) ;
10 ComponentId getComponentId ( ) ;11 } ;12
13 i n t e r f a c e I R e c e p t a c l e s {14 Connec t i on Id connect ( i n s t r i n g r e c e p t a c l e , i n Object ob j )15 r a i s e s ( Inva l idName , I n v a l i dConn e c t i o n , A l readyConnected ,16 ExceededConnec t i onL im i t ) ;17 vo id d i s c o nn e c t ( i n Connec t i on Id i d )18 r a i s e s ( I n v a l i dConn e c t i o n , NoConnect ion ) ;19 Conn e c t i o nDe s c r i p t i o n s ge tConnec t i on s ( i n s t r i n g r e c e p t a c l e )20 r a i s e s ( Inva l idName ) ;21 } ;22
23 i n t e r f a c e IM e t a I n t e r f a c e {24 Fa c e tD e s c r i p t i o n s g e tFa c e t s ( ) ;25 Fa c e tD e s c r i p t i o n s getFacetsByName ( i n NameList names )26 r a i s e s ( Inva l idName ) ;27 Re c e p t a c l eD e s c r i p t i o n s g e tR e c e p t a c l e s ( ) ;28 Re c e p t a c l eD e s c r i p t i o n s getReceptac lesByName ( i n NameList names )29 r a i s e s ( Inva l idName ) ;30 } ;31 } ; } ;
Apendice A. Apendice 105
Codigo A.3: Interfaces do conteiner da Infraestrutura de Execucao do SCS1 #in c l u d e ” s c s . i d l ”2 #in c l u d e ” d e p l o yme n t d e s c r i p t i o n s . i d l ”3
4 module s c s { module c o n t a i n e r {5 typede f sequence<uns igned long> I n t e r c e p t o r I d s ;6
7 s t r u c t ComponentHandle {8 co r e : : IComponent cmp ;9 co r e : : ComponentId i d ;
10 uns igned long i n s t a n c e i d ;11 } ;12 typede f sequence<ComponentHandle> ComponentHandleSeq ;13
14 except i on ComponentNotFound {} ;15 except i on ComponentAlreadyLoaded {} ;16 except i on LoadFa i l u r e {} ;17 except i on I n t e r c e p t o r N o t I n s t a l l e d {} ;18 except i on L i s t L o c k F a i l {} ;19 except i on Con ta i n e rHa l t ed {} ;20
21 i n t e r f a c e ComponentLoader {22 ComponentHandle l o ad ( i n co r e : : ComponentId id , i n S t r i ngSeq a r g s )23 r a i s e s ( ComponentNotFound , ComponentAlreadyLoaded , LoadFa i l u r e ) ;24 vo id un load ( i n ComponentHandle hand l e )25 r a i s e s ( ComponentNotFound ) ;26 } ;27
28 i n t e r f a c e ComponentCo l l e c t i on {29 ComponentHandleSeq getComponent ( i n co r e : : ComponentId i d ) ;30 ComponentHandleSeq getComponents ( ) ;31 } ;32
33 i n t e r f a c e Component In t e r c ep t i on {34 // 0 i n p o s i t i o n count s as end o f the l i s t .35 // The same goes f o r p o s i t i o n s above the l i s t ’ s c u r r e n t s i z e .36 ComponentHandle l o a d I n t e r c e p t o r ( i n co r e : : ComponentId id ,37 i n S t r i ngSeq args , i n uns igned long p o s i t i o n ,38 i n s t r i n g type )39 r a i s e s ( L i s t L o c kF a i l , ComponentNotFound ,40 ComponentAlreadyLoaded , Lo adFa i l u r e ) ;41 vo id u n l o a d I n t e r c e p t o r ( i n ComponentHandle hand l e )42 r a i s e s ( I n t e r c e p t o r N o t I n s t a l l e d , L i s t L o c kF a i l , ComponentNotFound ) ;43 vo id changePo s i t i o n ( i n uns igned long i n s t a n c e i d ,44 i n uns igned long p o s i t i o n )45 r a i s e s ( I n t e r c e p t o r N o t I n s t a l l e d , L i s t L o c kF a i l , ComponentNotFound ) ;46 uns igned long g e t I n t e r c e p t o r P o s i t i o n ( i n uns igned long i n s t a n c e i d )47 r a i s e s ( I n t e r c e p t o r N o t I n s t a l l e d , L i s t L o c kF a i l , ComponentNotFound ) ;48 I n t e r c e p t o r I d s g e t C l i e n t I n t e r c e p t o r s O r d e r ( ) ;49 I n t e r c e p t o r I d s g e t S e r v e r I n t e r c e p t o r sO r d e r ( ) ;50 } ;51
52 i n t e r f a c e ComponentSuspens ion {53 vo id suspend ( ) ;54 vo id h a l t ( ) ;55 vo id resume ( ) ;56 l ong g e tS t a t u s ( ) ;57 // s t a t u s : 0 means no s u s p en s i o n58 // p o s i t i v e number means a h a l t ( l a un che s e x c e p t i o n )59 // n e g a t i v e number means a s u s p en s i o n ( y i e l d s c o r o u t i n e s )60 } ;61 } ; } ;
Apendice A. Apendice 106
Codigo A.4: Interfaces do no de execucao da Infraestrutura de Execucao doSCS1 #in c l u d e ” s c s . i d l ”2 #in c l u d e ” c o n t a i n e r . i d l ”3 #in c l u d e ” d e p l o yme n t d e s c r i p t i o n s . i d l ”4
5 module s c s { module e x e cu t i o n node {6 typede f sequence<St r ingSeq> ArgsSeq ;7
8 except i on Con t a i n e rA l r e a d yE x i s t s {} ;9 except i on I n v a l i d C o n t a i n e r {} ;
10 except i on RequirementNotMet{ s t r i n g r e a son ; } ;11 except i on I n v a l i d P r o p e r t y { s t r i n g r e a son ; } ;12 except i on ComponentNot In s ta l l ed { s t r i n g r e a son ; } ;13
14 s t r u c t Prope r t y {15 s t r i n g name ;16 s t r i n g v a l u e ;17 boolean r e a d o n l y ;18 } ;19 typede f sequence<Proper ty> Prope r tySeq ;20
21 s t r u c t Con t a i n e rD e s c r i p t i o n {22 co r e : : IComponent c o n t a i n e r ;23 s t r i n g con ta i ne r name ;24 co r e : : IComponent e x e cu t i o n node ;25 } ;26 typede f sequence<Con t a i n e rDe s c r i p t i o n > Con t a i n e rDe s c r i p t i o nS eq ;27
28 i n t e r f a c e Execut ionNode {29 co r e : : IComponent s t a r t C o n t a i n e r ( i n s t r i n g conta ine r name ,30 i n Prope r tySeq props )31 r a i s e s ( Con t a i n e rA l r e a d yE x i s t s , I n v a l i d P r o p e r t y ) ;32 vo id k i l l C o n t a i n e r ( i n s t r i n g con ta i ne r name )33 r a i s e s ( co r e : : Inva l idName ) ;34 co r e : : IComponent g e tCon t a i n e r ( i n s t r i n g con ta i ne r name ) ;35 Con t a i n e rDe s c r i p t i o nS eq g e tCon t a i n e r s ( ) ;36 s t r i n g getName ( ) ;37 s t r i n g ge tP l a t f o rm ( ) ;38 } ;39
40 i n t e r f a c e Conta inerManager {41 vo id r e g i s t e r C o n t a i n e r ( i n s t r i n g name , i n co r e : : IComponent c t r ,42 i n s t r i n g p id )43 r a i s e s ( Con t a i n e rA l r e a d yE x i s t s , I n v a l i d C o n t a i n e r ) ;44 vo id u n r e g i s t e r C o n t a i n e r ( i n s t r i n g name) r a i s e s ( co r e : : Inva l idName ) ;45 } ;46
47 i n t e r f a c e I n s t a l l e r {48 vo id i n s t a l l ( i n co r e : : ComponentId id , i n s t r i n g l a ng )49 r a i s e s ( ComponentNot In s ta l l ed ) ;50 vo id u n i n s t a l l ( i n co r e : : ComponentId id , i n s t r i n g l a ng ) ;51 S t r i ngSeq getEnvVars ( i n s t r i n g l a ng ) ;52 s t r i n g getRootPath ( i n s t r i n g l a ng ) ;53 S t r i ngSeq getDependenc i e sPath ( i n co r e : : ComponentId id ,54 i n s t r i n g l a ng ) ;55 s t r i n g g e t I n s t a l l P a t h ( i n co r e : : ComponentId id , i n s t r i n g l a ng ) ;56 co r e : : ComponentIdSeq g e t I n s t a l l e dComponen t s ( i n s t r i n g l a ng ) ;57 d ep l o y e r : : ComponentDesc r ip t ion g e tD e s c r i p t i o n ( i n co r e : : ComponentId id ,58 i n s t r i n g l a ng )59 r a i s e s ( ComponentNot In s ta l l ed ) ;60 } ;61 } ; } ;
Apendice A. Apendice 107
Codigo A.5: Interfaces do repositorio da Infraestrutura de Execucao do SCS1 #in c l u d e ” d e p l o yme n t d e s c r i p t i o n s . i d l ”2
3 module s c s { module r e p o s i t o r y {4 except i on ComponentAlreadyUploaded {} ;5 except i on ComponentNotUploaded {} ;6
7 s t r u c t Con s t r a i n t {8 s t r i n g key ;9 s t r i n g v a l u e ;
10 } ;11 typede f sequence<Con s t r a i n t > Con s t r a i n tS eq ;12
13 i n t e r f a c e ComponentRepos i tory {14 vo id up load ( i n d ep l o y e r : : Package pkg , i n s t r i n g h e l p i n f o )15 r a i s e s ( ComponentAlreadyUploaded , ComponentNotUploaded ) ;16
17 vo id d e l e t e ( i n co r e : : ComponentId id , i n s t r i n g l ang , i n s t r i n g p l a t )18 r a i s e s ( ComponentNotUploaded ) ;19
20 vo id copy ( i n d ep l o y e r : : ComponentDesc r ip t ion desc ,21 i n ComponentRepos i tory repo )22 r a i s e s ( ComponentAlreadyUploaded , ComponentNotUploaded ) ;23
24 d ep l o y e r : : Package download ( i n co r e : : ComponentId id ,25 i n s t r i n g l ang , i n s t r i n g p l a t )26 r a i s e s ( ComponentNotUploaded ) ;27
28 d ep l o y e r : : ComponentDescr ipt ionSeq s e a r c h (29 i n Con s t r a i n tS eq c o n s t r a i n t s ) ;30 d ep l o y e r : : ComponentDescr ipt ionSeq s ea r chBy Id (31 i n co r e : : ComponentId i d ) ;32
33 d ep l o y e r : : ComponentDesc r ip t ion g e tD e s c r i p t i o n (34 i n co r e : : ComponentId id ,35 i n s t r i n g l ang , i n s t r i n g p l a t )36 r a i s e s ( ComponentNotUploaded ) ;37
38 d ep l o y e r : : ComponentDescr ipt ionSeq g e t A l l D e s c r i p t i o n s ( ) ;39 } ;40 } ; } ;
Apendice A. Apendice 108
Codigo A.6: Definicao dos descritores do Modelo e Implementacao1 #in c l u d e ” s c s . i d l ”2
3 module s c s {4 typede f sequence<s t r i n g > S t r i ngSeq ;5 typede f sequence<octet> OctetSeq ;6
7 module d ep l o y e r {8 s t r u c t Phy s i c a l R e s o u r c e s {9 uns igned long cpu ;
10 uns igned long mem;11 s t r i n g os ;12 s t r i n g a rch ;13 uns igned long bandwidth ;14 } ;15
16 s t r u c t Hos tDe s c r i p t i o n {17 s t r i n g name ;18 s t r i n g i p ;19 uns igned long po r t ;20 Phy s i c a l R e s o u r c e s r e s o u r c e s ;21 S t r i ngSeq l anguage s ;22 } ;23 typede f sequence<Hos tDe s c r i p t i on > HostSeq ;24
25 s t r u c t Facet {26 s t r i n g name ;27 s t r i n g i n t e r f a c e n ame ;28 } ;29 typede f sequence<Facet> FacetSeq ;30
31 s t r u c t Recep t a c l e {32 s t r i n g name ;33 s t r i n g i n t e r f a c e n ame ;34 boolean i s m u l t i p l e x ;35 } ;36 typede f sequence<Receptac l e > Recep tac l eSeq ;37
38 s t r u c t ComponentTemplate {39 co r e : : ComponentId i d ;40 FacetSeq f a c e t s ;41 Recep tac l eSeq r e c e p t a c l e s ;42 } ;43 typede f sequence<ComponentTemplate> ComponentTemplateSeq ;44
45 s t r u c t A r t e f a c t {46 s t r i n g name ;47 s t r i n g c l a s s name ;48 } ;49 typede f sequence<Ar t e f a c t > Ar t e f a c tS eq ;50
51 s t r u c t ComponentDesc r ip t ion {52 co r e : : ComponentId t emp l a t e i d ;53 s t r i n g l a ng ;54 s t r i n g p l a t ;55 s t r i n g e n t r y p o i n t ;56 Ar t e f a c tS eq f a c e t s ;57 Ar t e f a c tS eq r e c e p t a c l e s ;58 } ;59 typede f sequence<ComponentDescr ipt ion> ComponentDescr ipt ionSeq ;60
61 s t r u c t Package {62 ComponentDesc r ip t ion i n f o ;63 OctetSeq f i l e ;64 } ;65 typede f sequence<Package> PackageSeq ;66 } ;67 } ;
Apendice A. Apendice 109
Codigo A.7: Definicoes das entidades virtuais do planejamento1 #in c l u d e ” s c s . i d l ”2 #in c l u d e ” deployment . i d l ”3 module s c s { module d ep l o y e r {4 except i on Al readyDep loyed {} ; except i on NotDeployed {} ;5 typede f sequence<ComponentEntity> ComponentEnt itySeq ;6 typede f sequence<Con t a i n e rEn t i t y > Con t a i n e rEn t i t yS eq ;7 typede f sequence<Execut ionNodeEnt i t y> Execut i onNodeEnt i t ySeq ;8 typede f sequence<Repo s i t o r yEn t i t y > Repo s i t o r yEn t i t y S e q ;9 i n t e r f a c e Deployment { // p r o c e s s o de imp lan ta c a o
10 boolean dep l oy ( ) r a i s e s ( A l r eadyDep loyed ) ;11 boolean d e p l o y c o nn e c t i o n s ( ) r a i s e s ( A l r eadyDep loyed ) ;12 boolean a c t i v a t e ( ) r a i s e s ( NotDeployed ) ;13 boolean d e a c t i v a t e ( ) r a i s e s ( NotDeployed ) ;14 boolean undep loy ( ) ;15 } ;16 // t i p o s de dados da conexao p l a n e j a d a17 s t r u c t FacetEndpo in t { Bas icComponentEnt i ty e n t i t y ; s t r i n g facetname ; } ;18 s t r u c t Recep t a c l eConne c t i o n s {19 s t r i n g receptname ; FacetEndpo intSeq endpo i n t s ;20 } ;21 typede f sequence<FacetEndpo int> FacetEndpo intSeq ;22 typede f sequence<Recep tac l eConnec t i on s > Recep ta c l eConnec t i on sSeq ;23 // Ent idade r e p r e s e n t a n t e de um componente da i n f r a e s t r u t u r a24 i n t e r f a c e Bas icComponentEnt i ty : Deployment {25 vo id s e t a r g s ( i n S t r i ngSeq a r g s ) ;26 vo id s e t i d ( i n ComponentId i d ) ;27 vo id s e t d e s c r i p t i o n ( i n ComponentTemplate desc ) ;28 ComponentTemplate g e t d e s c r i p t i o n ( ) ;29 vo id add connec t i on ( i n s t r i n g r e c ep t ,30 i n Bas icComponentEnt i ty p r o v i d e r , i n s t r i n g f a c e t ) ;31 vo id d e l c o n n e c t i o n ( i n s t r i n g r e c ep t ,32 i n Bas icComponentEnt i ty p r o v i d e r , i n s t r i n g f a c e t ) ;33 Recep tac l eConnec t i on sSeq g e t c o n n e c t i o n s ( ) ;34 vo id s e t p r o p e r t y ( i n s t r i n g name , i n s t r i n g v a l u e ) ;35 s t r i n g g e t p r o p e r t y ( i n s t r i n g name ) ;36 s t r i n g get n i ckname ( ) ;37 Plan g e t p l a n ( ) ;38 Object g e t f a c e t ( i n s t r i n g facetname ) r a i s e s ( NotDeployed ) ;39 } ;40 // Ent idade r e p r e s e n t a n t e dos componentes do u s u a r i o41 i n t e r f a c e ComponentEnt i ty : Bas i cComponentEnt i ty {42 vo id s e t c o n t a i n e r ( i n Con t a i n e r En t i t y c o n t a i n e r ) ;43 Con t a i n e r En t i t y g e t c o n t a i n e r ( ) ;44 } ;45 // Ent idade r e p r e s e n t a n t e do c o n t e i n e r46 i n t e r f a c e Con t a i n e r En t i t y : Bas i cComponentEnt i ty {47 vo id s e t node ( i n Execu t i onNodeEnt i t y node ) ;48 Execu t i onNodeEnt i t y ge t node ( ) ;49 } ;50 // Ent idade r e p r e s e n t a n t e do no de execu c ao51 i n t e r f a c e Execu t i onNodeEnt i t y : Bas i cComponentEnt i ty {52 vo id s e t h o s t ( i n Hos tDe s c r i p t i o n hos t ) ;53 Hos tDe s c r i p t i o n g e t h o s t ( ) ;54 vo id a d d k n own r e p o s i t o r i e s ( i n Rep o s i t o r y E n t i t y repo ) ;55 vo id d e l k n o w n r e p o s i t o r i e s ( i n Rep o s i t o r y E n t i t y repo ) ;56 } ;57 // Ent idade r e p r e s e n t a t e do r e p o s i t o r i o58 i n t e r f a c e Rep o s i t o r y E n t i t y : Bas icComponentEnt i ty {59 vo id s e t h o s t ( i n Hos tDe s c r i p t i o n hos t ) ;60 Hos tDe s c r i p t i o n g e t h o s t ( ) ;61 vo id s e t p r i v a c y ( i n boolean p r i v a t e ) r a i s e s ( A l r eadyDep loyed ) ;62 boolean g e t p r i v a c y ( ) ;63 vo id p u b l i s h d e s c ( i n ComponentTemplate s t r u c t u r e ) ;64 vo id pub l i s h p k g ( i n Package pkg ) ;65 vo id unpub l i s h d e s c ( i n co r e : : ComponentId i d ) ;66 vo id unpub l i s h pkg ( i n co r e : : ComponentId id ,67 i n s t r i n g l ang , i n s t r i n g p l a t ) ;68 ComponentTemplate g e t d e s c ( i n co r e : : ComponentId i d ) ;69 Package ge t pkg ( i n co r e : : ComponentId id ,70 i n s t r i n g l ang , i n s t r i n g p l a t ) ;71 ComponentDescr ipt ionSeq s e a r c h b y i d ( i n co r e : : ComponentId i d ) ;72 } ; } ; } ;
Apendice A. Apendice 110
Codigo A.8: Interfaces dos Servicos DeployManager e Packager1 #in c l u d e ” s c s . i d l ”2 #in c l u d e ” d e p l o y e r e n t i t i e s . i d l ”3
4 module s c s { module d ep l o y e r {5 except i on I n t e r n a lP r o b l em { s t r i n g r e a son ; } ;6 except i on I n v a l i dPa c k ag e { s t r i n g r e a son ; } ;7 except i on Bu i l d E r r o r { s t r i n g r e a son ; } ;8 except i on Pub l i s h E r r o r {} ;9
10 // Plano de imp lan ta c a o11 i n t e r f a c e Plan : Deployment {12 // p lane jamento13 ComponentEnt i ty c r ea te component ( ) ;14 Con t a i n e r En t i t y c r e a t e c o n t a i n e r ( i n s t r i n g l a ng ) ;15 Execu t i onNodeEnt i t y c r e a t e e x nod e ( ) ;16 Rep o s i t o r y E n t i t y c r e a t e r e p o s i t o r y ( ) ;17 // i n s p e c a o18 ComponentEnt itySeq get components ( ) ;19 Con t a i n e rEn t i t yS eq g e t c o n t a i n e r s ( ) ;20 Execut i onNodeEnt i t ySeq ge t node s ( ) ;21 Repo s i t o r yEn t i t y S e q g e t r e p o s i t o r i e s ( ) ;22 Manager get manager ( ) ;23 vo id mark as admin ( i n boolean f l a g ) ;24 Con t a i n e rEn t i t yS eq l e s s u s e d c o n t a i n e r s ( ) ;25 Execut i onNodeEnt i t ySeq l e s s u s e d n o d e s ( ) ;26 HostSeq l e s s u s e d h o s t s ( ) ;27 vo id s e t ma x c o n t a i n e r u s a g e ( i n long max ) ;28 l ong g e t max c on t a i n e r u s a g e ( ) ;29 vo id s e t max node usage ( i n long max ) ;30 l ong ge t max node usage ( ) ;31 } ;32 typede f sequence<Plan> PlanSeq ;33
34 // S e r v i c o para imp lan ta c a o d i s t r i b u ı d a35 i n t e r f a c e Manager {36 Plan c r e a t e p l a n ( ) ;37 vo id d e l e t e p l a n ( i n Plan p ) ;38 PlanSeq g e t p l a n s ( ) ;39 // c on f i g u r a c a o e n t r e componentes40 boolean connect component ( i n ComponentEnt i ty consumer ,41 i n s t r i n g r e c ep t , i n ComponentEnt i ty p r o v i d e r ,42 i n s t r i n g f a c e t ) ;43 // compar t i l hando r e p o s i t o r i o s p u b l i c o s e n t r e p l ano s44 vo id a d d p u b l i c r e p o s i t o r i e s ( i n Rep o s i t o r y E n t i t y repo )45 r a i s e s ( I n t e r n a lP r o b l em ) ;46 vo id d e l p u b l i c r e p o s i t o r i e s ( i n Rep o s i t o r y E n t i t y repo )47 r a i s e s ( I n t e r n a lP r o b l em ) ;48 Repo s i t o r yEn t i t y S e q g e t p u b l i c r e p o s i t o r i e s ( )49 r a i s e s ( I n t e r n a lP r o b l em ) ;50 // r e g i s t r o de r e c u r s o s51 HostSeq g e t h o s t s ( ) ;52 } ;53 // S e r v i c o para empacotamento54 i n t e r f a c e Packager {55 Package c r e a t e ( i n OctetSeq rock spec s t r e am , i n OctetSeq imp l s t r eam ,56 out ComponentTemplate tmpl )57 r a i s e s ( I n va l i dPackage , Bu i l d E r r o r ) ;58 Package c r e a t e f r o m d i r ( i n s t r i n g r o c k s p e c f i l e , i n s t r i n g dirname ,59 out ComponentTemplate tmpl )60 r a i s e s ( I n va l i dPackage , Bu i l d E r r o r ) ;61 } ;62 } ; } ;
Apendice A. Apendice 111
Codigo A.9: Algoritmo de decisao para associar um componente a um conteinerautomaticamente1 f u n c t i o n ComponentEnt i ty : a u t o f i t c o n t a i n e r ( a v a i l a b l e im p l em e n t a t i o n s )2 l o c a l found , node , l anguage3 l o c a l p l an = s e l f . p l an4 l o c a l e x i s t e n t c o n t a i n e r s = s e l f : l e s s u s e d c o n t a i n e r s ( )5 f o r i , c o n t a i n e r i n i p a i r s ( e x i s t e n t c o n t a i n e r s ) do
6 i f p l an : g e t s c o r e ( c o n t a i n e r ) < p l an : g e t max c on t a i n e r u s a g e ( ) then
7 l anguage = c o n t a i n e r : g e t p r o p e r t y ( ” language ” )8 i f a v a i l a b l e im p l em e n t a t i o n s [ l anguage ] then
9 node = c o n t a i n e r : g e t node ( )10 i f not node then −−no de execu c ao nao t i n h a s i d o e s p e c i f i c a d o11 node = s e l f : a u t o f i t e x n o d e ( a v a i l a b l e imp l eme n t a t i o n s , l anguage )12 end
13 p l a t f o rm = node : g e t p r o p e r t y ( ” p l a t f o rm ” )14 i f a v a i l a b l e im p l em e n t a t i o n s [ l anguage ] [ p l a t f o rm ] then
15 found = c o n t a i n e r16 i f not c o n t a i n e r : ge t node ( ) then
17 c o n t a i n e r : s e t node ( node )18 end
19 break
20 end
21 end
22 e l s e
23 −−cont inuamos buscando algum c o n t a i n e r e x i s t e n t e que possa s e r usado24 end
25 end
26 −−nao achamos nenhum con t a i n e r compat ı v e l , ent ao vamos c r i a r um novo27 i f not found then
28 l a n g c o n s t r a i n t = next ( a v a i l a b l e im p l em e n t a t i o n s )29 found = p lan : c r e a t e c o n t a i n e r ( l a n g c o n s t r a i n t )30 node = s e l f : a u t o f i t e x n o d e ( a v a i l a b l e imp l eme n t a t i o n s , l a n g c o n s t r a i n t )31 found : s e t e xnod e ( node )32 end
33 r e t u r n found34 end
Apendice A. Apendice 112
Codigo A.10: Algoritmo de decisao para associar um conteiner a um no deexecucao automaticamente1 f u n c t i o n ComponentEnt i ty : a u t o f i t e x n o d e ( a v a i l a b l e imp l eme n t a t i o n s ,2 l a n g c o n s t r a i n t )3 l o c a l p l an = s e l f . p l an4 l o c a l found , host , p l a t f o rm5 l o c a l e x i s t e n t n o d e s = s e l f : l e s s u s e d n o d e s ( )6 f o r i , node i n i p a i r s ( e x i s t e n t n o d e s ) do
7 i f p l an : g e t s c o r e ( node ) < p l an : ge t max node usage ( ) then
8 p l a t f o rm = node : g e t p r o p e r t y ( ” p l a t f o rm ” )9 i f not p l a t f o rm then
10 hos t = s e l f : a u t o f i t h o s t ( a v a i l a b l e imp l eme n t a t i o n s ,11 l a n g c o n s t r a i n t , p l a t c o n s t r a i n t )12 p l a t f o rm = p l a t c o n s t r a i n t or ( hos t . r e s o u r c e s . os . .13 ”−” . . ho s t . r e s o u r c e s . a r ch )14 e l s e
15 hos t = node : g e t h o s t ( )16 end
17 f o r j , s u ppo r t e d l a n g i n i p a i r s ( hos t . l anguage s ) do
18 i f ( s u ppo r t e d l a n g == l a n g c o n s t r a i n t ) and
19 ( a v a i l a b l e im p l em e n t a t i o n s [ s u ppo r t e d l a n g ] [ p l a t f o rm ] )20 then
21 found = node22 i f not node : g e t h o s t ( ) then
23 node : s e t h o s t ( hos t )24 end
25 break
26 end
27 end
28 e l s e
29 −−cont inuamos buscando algum no de execu c ao que pos sa s e r usado30 end
31 end
32 −−nao achamos nenhum no de execu c ao compat ı v e l , ent ao vamos u sa r um out ro33 i f not found then
34 p l a t f o r m l i s t = next ( a v a i l a b l e im p l em e n t a t i o n s [ l a n g c o n s t r a i n t ] )35 p l a t c o n s t r a i n t = next ( p l a t f o r m l i s t )36 found = p lan : c r e a t e e x nod e ( )37 hos t = s e l f : a u t o f i t h o s t ( a v a i l a b l e imp l eme n t a t i o n s ,38 l a n g c o n s t r a i n t , p l a t c o n s t r a i n t )39 found : s e t h o s t ( hos t )40 end
41 r e t u r n found42 end
Apendice A. Apendice 113
Codigo A.11: Algoritmo de decisao para associar um no de execucao a umamaquina automaticamente1 f u n c t i o n ComponentEnt i ty : a u t o f i t h o s t ( a v a i l a b l e imp l eme n t a t i o n s ,2 l a n g c o n s t r a i n t , p l a t c o n s t r a i n t )3 l o c a l found , p l a t f o rm4 l o c a l e x i s t e n t h o s t s = s e l f : l e s s u s e d h o s t s ( )5 f o r i , ho s t i n i p a i r s ( e x i s t e n t h o s t s ) do
6 p l a t f o rm = hos t . r e s o u r c e s . os . . ”−” . . ho s t . r e s o u r c e s . a r ch7 −−s o e x i s t e 1 ’ no de execu c ao ’ por ’ ho s t ’8 i f p l a t f o rm == p l a t c o n s t r a i n t then
9 f o r i , l anguage i n i p a i r s ( hos t . l anguage s ) do
10 i f l anguage == l a n g c o n s t r a i n t then
11 found = hos t12 break
13 end
14 end
15 i f found then break end
16 end
17 end
18 i f not found then
19 e r r o r ( ”Nao e x i s t e maquina para a p l a t a f o rma s o l i c i t a d a : ” ,20 p l a t c o n s t r a i n t )21 end
22 r e t u r n found23 end