Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Component
  • Default Component
  • Non Sticky Component
  • Collocated Component

  • Dynamic Component

  • AutoStart Component

  • Immortal Component

  • Delayed Deactivation Component

Each of the components type differentiates of each other in one or more of the following areas:

  • Configuration
  • Request Procedure
  • Lifecycle Behavior

Presentation

  • Scope
    • Describe Component Types
    • Particularities on the 3 areas for each component type
  • Duration: 10 minutes

...

Code Block
languagepy
linenumberstrue
collapsetrue
from Acspy.Clients.SimpleClient import PySimpleClient
client = PySimpleClient()
compName = 'CLOCKTEST'


compInfo = cclient.availableComponents(compName)
if len(compInfo) != 1:
    print("Problem with the component: there should be one definition.")
compInfo = compInfo[0]
if not compInfo.reference is None:
    print("Problem with the component: it is already active.")
if len(compInfo.clients) > 0:
    print("Problem with the component: someone already has a reference to it.")


clock = client.getComponent(compName)
compInfo = cclient.availableComponents(compName)[0]
if compInfo.reference is None:
    print("Problem with the component: it should have been activated.")
if len(compInfo.clients) != 1:
    print("Problem with the component: it has not been activated or more than one component/client have a reference to it.")


client.releaseComponent(clock.name)
compInfo = cclient.availableComponents(compName)[0]
if not compInfo.reference is None:
    print("Problem with the component: it should have been deactivated.")
if len(compInfo.clients) > 0:
    print("Problem with the component: someone still has a reference to it.")

...

Code Block
languagepy
linenumberstrue
collapsetrue
from Acspy.Clients.SimpleClient import PySimpleClient
client = PySimpleClient()
compName = 'CLOCKTEST'


compInfo = cclient.availableComponents(compName)
if len(compInfo) != 1:
    print("Problem with the component: there should be one definition.")
compInfo = compInfo[0]
if not compInfo.reference is None:
    print("Problem with the component: it is already active.")
if len(compInfo.clients) > 0:
    print("Problem with the component: someone already has a reference to it.")


clock = client.getDefaultComponent('IDL:alma/acstime/Clock:1.0')
compInfo = cclient.availableComponents(compName)[0]
if compInfo.reference is None:
    print("Problem with the component: it should have been activated.")
if len(compInfo.clients) != 1:
    print("Problem with the component: it has not been activated or more than one component/client have a reference to it.")


client.releaseComponent(clock.name)
compInfo = cclient.availableComponents(compName)[0]
if not compInfo.reference is None:
    print("Problem with the component: it should have been deactivated.")
if len(compInfo.clients) > 0:
    print("Problem with the component: someone still has a reference to it.")

...

Code Block
languagepy
linenumberstrue
collapsetrue
from Acspy.Clients.SimpleClient import PySimpleClient
client = PySimpleClient()
compName = 'CLOCKTEST'


compInfo = cclient.availableComponents(compName)
if len(compInfo) != 1:
    print("Problem with the component: there should be one definition.")
compInfo = compInfo[0]
if not compInfo.reference is None:
    print("Problem with the component: it is already active.")
if len(compInfo.clients) > 0:
    print("Problem with the component: someone already has a reference to it.")


tmp = client.getComponent(compName)
compInfo = cclient.availableComponents(compName)[0]
if compInfo.reference is None:
    print("Problem with the component: it should have been activated.")
if len(compInfo.clients) != 1:
    print("Problem with the component: it has not been activated or more than one component/client have a reference to it.")


clock = client.getComponentNonSticky(compName)
compInfo = cclient.availableComponents(compName)[0]
if len(compInfo.clients) != 1:
    print("Problem with the component: it has not been activated or more than one component/client have a reference to it.")


client.releaseComponent(tmp.name)
compInfo = cclient.availableComponents(compName)[0]
if not compInfo.reference is None:
    print("Problem with the component: it should have been deactivated.")
if len(compInfo.clients) > 0:
    print("Problem with the component: someone still has a reference to it.")

...

Code Block
languagepy
linenumberstrue
collapsetrue
from Acspy.Clients.SimpleClient import PySimpleClient
import maci

client = PySimpleClient()
compNamecompSpec = maci.ComponentSpec("CLOCKTEST", "*", "*", "*")
comp = client.getCollocatedComp(compSpec, False, "CLOCKTEST")

Dynamic Component

Configuration

Code Block
titleComponents.xml
linenumberstrue
collapsetrue
<e Name="*"
   Code="acsclock"
   Type="IDL:alma/acstime/Clock:1.0"
   Container="*"
   ImplLang="cpp"
   KeepAliveTime="0"
   Autostart="false"
   Default="false"
>
</e>

Request (Python)

Code Block
languagepy
linenumberstrue
collapsetrue
from Acspy.Clients.SimpleClient import PySimpleClient
client = PySimpleClient()
compName = 'CLOCKTEST'
compType = 'IDL:alma/acstime/Clock:1.0'
container = bilboContainer

compInfo = client.availableComponents(compName'CLOCKTEST'


compInfo = c.availableComponents('CLOCKTEST')
if len(compInfo) != 1:
    print("Problem with the component: there should be one definition.")
compInfo = compInfo[0]
if not compInfo.reference is None:
    print("Problem with the component: it is already active.")
if len(compInfo.clients) > 0:
    print("Problem with the component: someone already has a reference to it.")


clock = client.getComponent()
compInfo = c.availableComponents('CLOCKTEST')[0]
if compInfo.reference is None:
    print("Problem with the component: it should have been activated.")
if len(compInfo.clients) != 10:
    print("Problem with the component: itthere hasshouldn't notbe been activated or more than one component/client have a reference to it.")


client.releaseComponent(clock.name)
any definition.")

clock = client.getDynamicComponent(compName, '*', compType, container)
compInfo = cclient.availableComponents('CLOCKTEST')[0]compName)
if len(compInfo.reference) is!= None1:
    print("Problem with the component: itthere should havebe beenone deactivateddefinition.")
if compInfo = compInfo[0]
if compInfo.reference is None:
    print("Problem with the component: it should have been activated.")
if len(compInfo.clients) >!= 01:
    print("Problem with the component: someone stillit has anot referencebeen to it.")

Dynamic Component

Configuration

Code Block
titleComponents.xml
linenumberstrue
collapsetrue
<e Name="*"
   Code="acsclock"
   Type="IDL:alma/acstime/Clock:1.0"
   Container="*"
   ImplLang="cpp"
   KeepAliveTime="0"
   Autostart="false"
   Default="false"
>
</e>

Request (Python)

activated or more than one component/client have a reference to it.")

client.releaseComponent(clock.name)
compInfo = client.availableComponents(compName)[0]
if not compInfo.reference is None:
    print("Problem with the component: it should have been deactivated.")
if len(compInfo.clients) > 0:
    print("Problem with the component: someone still has a reference to it.")

Auto Start Component

Configuration

Code Block
titleComponents.xml
linenumberstrue
collapsetrue
<e Name="CLOCKTEST"
   Code="acsclock"
   Type="IDL:alma/acstime/Clock:1.0"
   Container="bilboContainer"
   ImplLang="cpp"
   KeepAliveTime="0"
   Autostart="true"
   Default="false"
>
</e>

Request (Python)

Code Block
languagepy
linenumberstrue
collapsetrue
from Acspy.Clients.SimpleClient import PySimpleClient
client = PySimpleClient()
compName = 'CLOCKTEST'

compInfo = client.availableComponents(compname)
if len(compInfo) != 1:
    print("Problem with the component: there should be one definition.")
compInfo = compInfo[0]
if compInfo.reference is None:
    print("Problem with the component: It should be already active.")
if len(compInfo.clients) != 1:
    print("Problem with the component: There should be only one reference to it.")
if compInfo.clients[0] != 83886080
Code Block
languagepy
linenumberstrue
collapsetrue
from Acspy.Clients.SimpleClient import PySimpleClient
client = PySimpleClient()
compName = 'CLOCKTEST'
compType = 'IDL:alma/acstime/Clock:1.0'
container = bilboContainer


compInfo = c.availableComponents(compName)
if len(compInfo) != 0:
    print("Problem with the component: there shouldn't be any definition The manager should have a reference to it.")


clock = client.getDynamicComponentgetComponent(compName, '*', compType, container)
compInfo = cclient.availableComponents(compName)[0]
if len(compInfo.clients) != 12:
    print("Problem with the component: thereThere should be one definition."2 references; 1 from manager and the other from our client.")

client.releaseComponent(clock.name)
compInfo = compInfoc.availableComponents(compName)[0]
if compInfo.reference is None:
    print("Problem with the component: itIt shouldshouldn't havebe been activateddeactivated.")
if len(compInfo.clients) != 1:
    print("Problem with the component: itOnly hasthe not been activated or more than one component/client Manager should have a reference to it.")


client.releaseComponent(clock.name)
compInfo = c.availableComponents('CLOCKTEST')[0]
if not compInfo.reference is None:
    print("Problem with the component: it should have been deactivated.")
if len(compInfo.clients) > 0:
    print("Problem with the component: someone still has a reference to it.")

Auto Start Component

Configuration

Immortal Component

Configuration

Code Block
titleComponents.xml
linenumberstrue
collapsetrue
<e Name="CLOCKTEST"
   Code="acsclock"
   Type="IDL:alma/acstime/Clock:1.0"
   Container="bilboContainer"
   ImplLang="cpp"
   KeepAliveTime="-1"
   Autostart="false"
   Default="false"
>
</e>

Request (Python)

Code Block
languagepy
Code Block
titleComponents.xml
linenumberstrue
collapsetrue
<e Name="CLOCKTEST"
   Code="acsclock"
   Type="IDL:alma/acstime/Clock:1.0"
   Container="bilboContainer"
   ImplLang="cpp"
   KeepAliveTime="0"
   Autostart="true"
   Default="false"
>
</e>

Request (Python)

true
from Acspy.Clients.SimpleClient import PySimpleClient
client = PySimpleClient()
compName = 'CLOCKTEST'

compInfo = c.availableComponents(compName)
if len(compInfo) != 1:
    print("Problem with the component: there should be one definition.")
compInfo = compInfo[0]
if not compInfo.reference is None:
    print("Problem with the component: it is already active."
Code Block
languagepy
linenumberstrue
collapsetrue
from Acspy.Clients.SimpleClient import PySimpleClient
client = PySimpleClient()
compName = 'CLOCKTEST'


compInfo = c.availableComponents(compname)
if len(compInfo.clients) !=> 10:
    print("Problem with the component: someone already therehas shoulda bereference oneto definitionit.")

clock = client.getComponent()
compInfo = compInfo c.availableComponents(compName)[0]
if compInfo.reference is None:
    print("Problem with the component: Itit should behave alreadybeen activeactivated.")
if len(compInfo.clients) != 12:
    print("Problem with the component: There should be only one reference to it.")
if compInfo.clients[0] != 83886080 2 references; 1 from manager and the other from our client.")

client.releaseComponent(clock.name)
compInfo = c.availableComponents(compName)[0]
if compInfo.reference is None:
    print("Problem with the component: TheIt managershouldn't should have a reference to itbe deactivated.")


clock = client.getComponent(compName)
compInfo = c.availableComponents(compName)[0]
if len(compInfo.clients) != 21:
    print("Problem with the component: There should be 2 references; 1 from manager and the other from our client.")


client.releaseComponent(clock.name)
compInfo = c.availableComponents(compName)[0]
if compInfo.reference is None:
    print("Problem with the component: It shouldn't be deactivated.")
if len(compInfo.clients) != 1:
    print("Problem with the component: Only the Manager should have a reference to it.")

Immortal Component

Configuration

Only the Manager should have a reference to it.")

Delayed Deactivation Component

Configuration

Code Block
titleComponents.xml
linenumberstrue
collapsetrue
<e Name="CLOCKTEST"
   Code="acsclock"
   Type="IDL:alma/acstime/Clock:1.0"
   Container="bilboContainer"
   ImplLang="cpp"
   KeepAliveTime="10"
   Autostart="false"
   Default="false"
>
</e>

Request (Python)

Code Block
languagepy
Code Block
titleComponents.xml
linenumberstrue
collapsetrue
<e Name="CLOCKTEST"
   Code="acsclock"
   Type="IDL:alma/acstime/Clock:1.0"
   Container="bilboContainer"
   ImplLang="cpp"
   KeepAliveTime="-1"
   Autostart="false"
   Default="false"
>
</e>

Request (Python)

Code Block
languagepy
linenumberstrue
collapsetrue
from Acspy.Clients.SimpleClient import PySimpleClient
client = PySimpleClient()
compName = 'CLOCKTEST'


compInfo = c.availableComponents('CLOCKTEST'import time
from Acspy.Clients.SimpleClient import PySimpleClient
client = PySimpleClient()
compName = 'CLOCKTEST'

compInfo = c.availableComponents(compName)
if len(compInfo) != 1:
    print("Problem with the component: there should be one definition.")
compInfo = compInfo[0]
if not compInfo.reference is None:
    print("Problem with the component: it is already active.")
if len(compInfo.clients) !=> 10:
    print("Problem with the component: there should be one definitionsomeone already has a reference to it.")

clock = client.getComponent(compName)
compInfo = compInfoc.availableComponents(compName)[0]
if not compInfo.reference is None:
    print("Problem with the component: it should ishave alreadybeen activeactivated.")
if len(compInfo.clients) >!= 02:
    print("Problem with the component: someone already has a reference to it.")


clock = client.getComponent( with the component: There should be 2 references; 1 from manager and the other from our client.")

client.releaseComponent(clock.name)
compInfo = c.availableComponents('CLOCKTEST'compName)[0]
if compInfo.reference is None:
    print("Problem with the component: itIt shouldshouldn't havebe been activateddeactivated.")
if len(compInfo.clients) != 21:
    print("Problem with the component: There should be 2 references; 1 from manager and the other from our clientOnly the Manager should have a reference to it.")


clienttime.releaseComponentsleep(clock.name20)
compInfo = c.availableComponents('CLOCKTEST'compName)[0]
if not compInfo.reference is None:
    print("Problem with the component: it Itshould shouldn'thave bebeen deactivated.")
if len(compInfo.clients) !=> 10:
    print("Problem with the component: Onlysomeone the Manager should havestill has a reference to it.")

Discussion

  • Limitations: CallbacksNew Component Types Ideas?
  • ImprovementsNew Ideas