ᚑくᄢቇℂᎿቇ⎇ⓥႎ๔
J. Fac. Sci. Tech., Seikei Univ.
Vol.46 No.1 (2009) pp.25-34
ᒝࡑࠗࠣ࡟࡯࡚ࠪࡦൻࡕࡃࠗ࡞ࠛ࡯ࠫࠚࡦ࠻ߩ⥄Ꮖࡃ࠶ࠢࠕ࠶ࡊᯏ᭴ߩታⵝട⮮ ผᓃ*1㧘↲᢫ ቬᓼ*2

Implementation of Self-backup Mechanism for Strong Migration Mobile Agents

Fumiaki KATOH*1 , Munenori KAI*2



ABSTRACT: The authors have developed the platform of the autonomic distributed processing system,
AgentSphere, which is based on strong migration mobile agent. In this paper, a new mechanism formaking backup of an agent itself with all the data obtained by the process at the backup point isintroduced into AgentSphere. Users can use this agent’s self-backup mechanism by describing “backup”
commands in an agent’s code. The backed-up agent is sent into other AgentSphere machines via anetwork. When the original agent will be unfortunately stopped or lost by a contingency, the backed-up
agent will wake up and be able to continue its process instead of the original agent. Thereby, the fault
tolerance of the system can be improved. In addition, the function which inserts automatically thebackup commands at the suitable locations in an agent code is proposed and implemented. Using thisfunction make it easy for users to transform their application agents into the agents with the self-backup
mechanism.

Keywords: mobile agent system, strong migration,self-backup(Received March 23, 2009)㧝㧚ߪߓ߼ߦ

ಽᢔಣℂߩᕲᕺࠍฃߌࠄࠇࠆࠃ߁ߦߔࠆߎߣ߇ᦸ߹ߒ޿‫ޕ‬ᧄ⎇ⓥቶߢߪ㧘ߎߩࠃ߁ߥ⥄ᓞಽᢔಣℂࠪࠬ࠹ࡓࠍࡕࡃ ৻⥸⊛ߦಽᢔಣℂࠪࠬ࠹ࡓߢߪ㧘࡙࡯ࠩ࠲ࠬࠢࠍಽᢔࠗ࡞ࠛ࡯ࠫࠚࡦ࠻ᛛⴚࠍ↪޿ߡ⹜૞ߒߡ߈ߚ‫ޕ‬ߐߖࠆ㓙ߦ㧘േ⊛ߦᄌൻߔࠆዪᚲ⊛߅ࠃ߮ో૕⊛ߥ⽶⩄ ߒ߆ߒ⹜૞ߦ↪޿ߡ߈ߚࡕࡃࠗ࡞ࠛ࡯ࠫࠚࡦ࠻ࠪࠬ࠹

ߩ⁁ᴫᛠី߿▤ℂ߇ᔅⷐߣߥࠆ‫ߪࠇߘޕ‬ಽᢔಣℂ㐿ᆎᤨࡓߪ㧘ᄙߊߩ Java ࡌ࡯ࠬߩࡕࡃࠗ࡞ࠛ࡯ࠫࠚࡦ࠻ࠪࠬ

ߩࡑࠪࡦᕈ⢻ߦวࠊߖߚ࠲ࠬࠢߩೋᦼಽᢔ߇ಣℂ⚳ੌ߹࠹ࡓห᭽ߦᒙࡑࠗࠣ࡟࡯࡚ࠪࡦߩࡕࡆ࡝࠹ࠖࠍ೑↪ߒߡߢㆡಾߢ޽ࠆߣߪ㒢ࠄߥ޿ߚ߼ߢ޽ࠅ㧘⽶⩄ߦࠃࠆࡑࠪ

޿ߚߚ߼㧘⒖േవߢ⒖േ೨ߩಣℂࠍ⛮⛯ߔࠆࠛ࡯ࠫࠚࡦ

ࡦߩಣℂ⢻ജߩᄌൻ߿ෳടࡑࠪࡦᢙߩᄌൻߣ޿ߞߚ᭽‫ޘ‬࠻ࠍ⥄↱ߦ⸥ㅀߔࠆߎߣ߇࿎㔍ߢ޽ߞߚ‫ޕ‬⒖േవߢߩಣ

ߥ⁁ᴫࠍ⠨ᘦߒߚࡊࡠࠣ࡜ࡓࠍ⸥ㅀߔࠆᔅⷐ߇޽ࠆ‫ߘޕ‬ℂߩ⛮⛯߇น⢻ߥᒝࡑࠗࠣ࡟࡯࡚ࠪࡦࡕࡃࠗ࡞ࠛ࡯ࠫࠚߩߚ߼ߦߪಽᢔಣℂ߅ࠃ߮ࠪࠬ࠹ࡓߩ᭴ㅧߦኻߔࠆ⹦⚦ࡦ࠻ࠪࠬ࠹ࡓࠍታ⃻ߔࠆߚ߼ߦߪ㧘⒖േߩ㓙ᜬߜㆇ߱ᖱߥ⍮⼂߿⚻㛎߇ᔅⷐߣߥࠅ㧘ࡊࡠࠣ࡜ࡓ⸥ㅀ⠪ߦߣߞߡႎߦᔅⷐߥ߽ߩߣߒߡ㧘ࡅ࡯ࡊ㗔ၞౝߩ࠺࡯࠲㧘ታⴕࠦ

ᄢ߈ߥ⽶ᜂߣߥࠆ‫ޕ‬࡯࠼㧘ࠬ࠲࠶ࠢ㗔ၞౝߩࡠ࡯ࠞ࡞ᄌᢙ㧘ࡊࡠࠣ࡜ࡓࠞ࠙ ߘߎߢࠪࠬ࠹ࡓߦෳടߒߡ޿ࠆࡑࠪࡦߩ⁁ᴫߩ್ᢿ࡮ࡦ࠲߇޽ࠆ‫ࡊ࡯ࡅޕ‬㗔ၞౝߩ࠺࡯࠲෸߮ታⴕࠦ࡯࠼ߩ⒖೙ᓮࠍ೑↪⠪߇ⴕࠊߥߊߡ߽㧘ࠪࠬ࠹ࡓ஥ߢ⥄ᓞ⊛ߦߘേߪ Java ⸒⺆ߦ஻ࠊߞߡ޿ࠆࠪ࡝ࠕ࡜ࠗ࠭ᯏ⢻ߢኈᤃࠇࠍⴕ߁ࠃ߁ߦߔࠆߎߣߢ㧘ࡊࡠࠣ࡜ࡓ⸥ㅀ⠪ߪࡔࠗࡦߦታ⃻಴᧪ࠆ‫ࠢ࠶࠲ࠬߒ߆ߒޕ‬㗔ၞౝߩࡠ࡯ࠞ࡞ᄌᢙߣߩ⸘▚ಣℂࠍⴕ߁ࠦ࡯࠼૞ࠅߦኾᔨߢ߈㧘⺕ߢ߽ᚻシߦࡊࡠࠣ࡜ࡓࠞ࠙ࡦ࠲ߦߟ޿ߡߪ㧘Java ᓥ᧪ߩᯏ⢻ߢߪታ⃻߇಴᧪ߥ߆ߞߚ‫ࠢ࠶࠲ࠬߢߎߘޕ‬㗔ၞౝߩࡠ࡯ࠞ࡞㧦Ꮏቇ⎇ⓥ⑼ᖱႎಣℂኾ᡹ୃ჻ቇ↢㧦Ꮏቇ⎇ⓥ⑼ᖱႎಣℂኾ᡹ᢎ᝼ MCK"UVUGKMGKCELRᄌ ᢙ ߩ ข ᓧ ߦ 㑐 ߒ ߡ ߪ 㧘 Java Platform Debugger

Architecture㧔એ㒠 JPDA㧕ࠍ೑↪ߒߡⴕ߁ߎߣߦߒߚ=?‫ޕ‬㧙㧙ߘߒߡ࠰࡯ࠬࠦ࡯࠼ᄌ឵ࠍⴕ߁ߎߣߦࠃࠅ㧘ࠬ࠲࠶ࠢ㗔ࠚࡦ࠻ࠍ೑↪ߔࠆߎߣߦߒߚ‫ޕ‬ၞౝߩࡠ࡯ࠞ࡞ᄌᢙࠍขᓧ࡮ᓳరߔࠆಣℂࠍ⥄േᝌ౉ߒ㧘ࠛ࡯ࠫࠚࡦ࠻ߣߪ㧘ੱ㑆ߩઍℂߣߒߡࠪࠬ࠹ࡓ਄ߢ⥄ࡊࡠࠣ࡜ࡓߩਛᢿ૏⟎߆ࠄಣℂࠍౣ㐿ߔࠆ᭴ㅧߦࡊࡠࠣᓞ⊛ߦⴕേߔࠆ࠰ࡈ࠻࠙ࠚࠕߢ޽ࠅ㧘ࡕࡃࠗ࡞ࠛ࡯ࠫࠚ

=?

࡜ࡓࠍ⥄േᄌ឵ߔࠆᣇᑼࠍታ⃻ߒߚ ‫ߩߎޕ‬ᓥ᧪ߩ⎇ⓥ

ࡦ࠻ߣߪ㧘ࡀ࠶࠻ࡢ࡯ࠢࠍㅢߓߡࡑࠪࡦ㑆ࠍ⒖േߒߥ߇

ߦࠃࠅ㧘⒖േ೨ߩಣℂࠍή㚝ߦߔࠆߎߣߥߊ⒖േవߢߩ

ࠄ࠲ࠬࠢಣℂࠍⴕ߁ߎߣ߇ߢ߈ࠆࠛ࡯ࠫࠚࡦ࠻ߩߎߣࠍಣℂߩ⛮⛯߇น⢻ߥᒝࡑࠗࠣ࡟࡯࡚ࠪࡦൻࡕࡃࠗ࡞ࠛ࡯⸒߁‫ߡߒߘޕ‬㧘ࡕࡃࠗ࡞ࠛ࡯ࠫࠚࡦ࠻ࠪࠬ࠹ࡓߣߪ㧘ࡕࠫࠚࡦ࠻ࠪࠬ࠹ࡓߩࡌ࡯ࠬ߇ቢᚑߒߚ‫ޕ‬ࡃࠗ࡞ࠛ࡯ࠫࠚࡦ࠻ߩേ૞㧔↢ᚑ㧘ᶖ෰㧘⒖േ㧘଻ሽ㧘

ߒ߆ߒ⒖േ೨ߩಣℂࠍ⛮⛯ߔࠆ๮઎ߦ߅޿ߡ㧘ขᓧ࡮ⶄ⵾㧘ㅢାߥߤ㧕ࠍឭଏߔࠆࠪࠬ࠹ࡓߩߎߣߢ޽ࠆ‫ޕ‬ᓳరߢ߈ࠆࡠ࡯ࠞ࡞ᄌᢙߪࡊ࡝ࡒ࠹ࠖࡉဳߣ String ဳ߅ࡕࡃࠗ࡞ࠛ࡯ࠫࠚࡦ࠻ࠪࠬ࠹ࡓߪᄢ߈ߊಽߌߡᒙࡑࠗࠃ߮ߘࠇࠄߩ㈩೉ߦ㒢ቯߐࠇߚ߽ߩߢ㧘ෳᾖဳߦߟ޿ߡࠣ࡟࡯࡚ࠪࡦࠪࠬ࠹ࡓߣᒝࡑࠗࠣ࡟࡯࡚ࠪࡦࠪࠬ࠹ࡓߦߪ⸥ㅀ಴᧪ࠆ߽ߩߩ㧘ขᓧ࡮ᓳరߪ಴᧪ߥ޿⁁ᘒߢ޽ߞಽߌࠄࠇࠆ‫ޕ‬ਔ⠪ߪᜬߜㆇ߮಴᧪ࠆᖱႎߦ㆑޿߇޽ࠅ㧘ߚ‫ߪߢ߹߹ߩߎޕ‬㧘ᄖㇱࠢ࡜ࠬࠍ೑↪ߒߚࡊࡠࠣ࡜ࡓ߇ᒙࡑࠗࠣ࡟࡯࡚ࠪࡦࠪࠬ࠹ࡓߢߪ㧘⒖േߩ㓙ᜬߜㆇ߱ᖱ⸥ㅀߢ߈ߕ㧘᭽‫ߥޘ‬⒳㘃ߩࡊࡠࠣ࡜ࡓࠍ⸥ㅀߢ߈ࠆࠪࠬႎ߇ਇචಽߥߚ߼㧘⒖േᓟߦߪ⒖േ೨ߩ⛯߈߆ࠄߩಣℂ࠹ࡓߣߪ⸒޿㔍޿‫⺰ᧄ߼ߚߩߘޕ‬ᢥߢߪ㧘߹ߕ㧘ෳᾖဳࠍⴕ߁ߎߣ߇಴᧪ߕ㧘ಣℂߪᦨೋ߆ࠄߦߥߞߡߒ߹޿㧘ߦߟ޿ߡขᓧ࡮ᓳర߇಴᧪ࠆࠃ߁ߦ⒖േ๮઎ߩᒝൻࠍⴕ

ߘࠇ߹ߢߩಣℂ߇ή㚝ߦߥߞߡߒ߹߁‫৻ޕ‬ᣇ㧘ᒝࡑࠗࠣ߁‫ޕ‬࡟࡯࡚ࠪࡦࠪࠬ࠹ࡓߢߪ⒖േᓟߦ⒖േ೨ߩ⛯߈߆ࠄߩಣ

߹ߚಽᢔಣℂࠪࠬ࠹ࡓߢߪ㜞ା㗬ᕈ߿⠴㓚ኂᕈ߇ᦼᓙ

ℂࠍⴕ߁ߎߣ߇಴᧪ࠆ߇㧘ታⵝ߇࿎㔍ߦߥࠆ‫ޕ‬ᣢሽ ߩ⎇ⓥߢ ߪ㧘 AgentSpace 㧔 ૒ ⮮৻ ㇢ ᳁㧕 =? ߿ߐࠇࠆ‫ߢߎߘޕ‬㧘ࠪࠬ࠹ࡓߩో૕ߥ⽶⩄ࠍ⷗ߥ߇ࠄ࠲ࠬ
ࠢߩౣ⽶⩄ಽᢔࠍⴕ߁ࠃ߁ߦߔࠆߎߣߢ㧘ᔕ╵ߩ㜞ㅦൻ

Aglets㧔ᣣᧄ IBM ␠㧕=?߇᜼ߍࠄࠇࠆ߇㧘ߎࠇࠄߪᒙࡑ

ߩߺߥࠄߕ㧘ᦝߥࠆ㜞ା㗬ᕈ߿⠴㓚ኂᕈߩะ਄ࠍ⷗ㄟ߻

ࠗࠣ࡟࡯࡚ࠪࡦࠪࠬ࠹ࡓߩߚ߼㧘వߦㅀߴߚᒙὐ߇޽ࠆ‫ޕ‬ߎߣ߇಴᧪ࠆ‫ࠍࠇߎޕ‬ታ⃻ߔࠆߚ߼ߦ㧘ᧄ⎇ⓥߢߪ㧘ࠛ߹ߚᣢሽߩ⎇ⓥߢ߽ᒝࡑࠗࠣ࡟࡯࡚ࠪࡦࠪࠬ࠹ࡓߩ⎇ⓥ࡯ࠫࠚࡦ࠻߇ಣℂࠍ޽ࠆ⒟ᐲⴕߞߚߣ߈ߦ㧘⥄ಽ⥄りߣߪⴕࠊࠇߡ޿ࠆ‫ ߒ߆ߒޕ‬JavaGO㧔᧲੩ᄢቇ☨Ỉ⎇ⓥቶ㧕=?

ߢߪ᳿߼ࠄࠇߚ૏⟎ߢߒ߆⁁ᘒߩ଻ሽ࡮ᓳᣥ߇಴᧪ߕ㧘ߘࠇ߹ߢߩಣℂߩㅜਛ⚿ᨐࠍࡃ࠶ࠢࠕ࠶ࡊߒ㧘ࡀ࠶࠻ࡢ࡯ࠢ਄ߢ #IGPV5RJGTG ߇േ૞ߔࠆઁߩࡑࠪࡦߦㅍࠅㄟ߻߹ߚ⒖േࠍታ⃻ߔࠆߚ߼ߦ࡜ࡦ࠲ࠗࡓࠪࠬ࠹ࡓࠍ᜛ᒛߒᯏ⢻ࠍട߃ࠆߎߣߦߒߚ‫ࠛߩ࡞࠽ࠫ࡝ࠝ߫߃଀ߡߒߘޕ‬ߚߎߣߢ㧘⒖േࡊࡠࠣ࡜ࡓߪ᜛ᒛߐࠇߚࡃࠗ࠻ࠦ࡯࠼ࠗ

࡯ࠫࠚࡦ࠻߇ਇ᷹ߩ੐ᘒߦࠃࠅ஗ᱛߒߚࠅᄬࠊࠇߚࠅߒࡦ࠲ࡊ࡝࠲߿㧘․ቯߩ JIT ࠦࡦࡄࠗ࡜਄ߢߒ߆േ૞ߒߥߚࠄ㧘ࡃ࠶ࠢࠕ࠶ࡊߐࠇߡ޿ߚࠛ࡯ࠫࠚࡦ࠻߇ᵴേࠍ㐿޿ࠃ߁ߦߥߞߡ޿ࠆߩߢ㧘⒖ᬀᕈ߇ᄬࠊࠇߡ޿ࠆߣ޿߁

ᆎߒ㧘ᦨᣂߩㅜਛ⚿ᨐࠍ↪޿ߡಣℂࠍౣ㐿ߢ߈ࠆࠃ߁ߦᒙὐ߇޽ࠆ‫ ߚ߹ޕ‬MOBA㧔㚂⮮৻ᐘ᳁㧕=?ߢߪ Java ઒ߔࠆ‫ᤨߩߤࠍࡊ࠶ࠕࠢ࠶ࡃߩ࠻ࡦࠚࠫ࡯ࠛߦࠄߐޕ‬ὐߢᗐࡑࠪࡦ㧔એ㒠 JVM㧕ߩᄌᦝ߿㧘ࡀࠗ࠹ࠖࡉࡔ࠰࠶࠼ߩขࠄߖࠆߩ߇⦟޿߆ࠍ᳿߼ࠆߎߣߪ࡙࡯ࠩߦߣߞߡኈᤃㅊടࠍߔࠆߎߣߢᒝࡑࠗࠣ࡟࡯࡚ࠪࡦࠍታ⃻ߒߡ޿ࠆߚߢߪߥ޿ߩߢ㧘ࠛ࡯ࠫࠚࡦ࠻ߩࠦ࡯࠼ࠍ⸃ᨆߒߡ⥄േ⊛߼⁛⥄ߩ JVM ࠍ೑↪ߔࠆᔅⷐ߇޽ࠅ㧘JVM ߩࡃ࡯࡚ࠫߦㆡಾߥ૏⟎ߦ⥄Ꮖࡃ࠶ࠢࠕ࠶ࡊ๮઎ࠍ⥄േᝌ౉ߔࠆᯏࡦࠕ࠶ࡊߦ઻޿ᒝࡑࠗࠣ࡟࡯࡚ࠪࡦߩߚ߼ᄌᦝߒߚ⢻߽ឭ᩺ߔࠆ‫ޕ‬

JVM ࠍୃᱜߔࠆᔅⷐ߇޽ࠆߚ߼ࠪࠬ࠹ࡓ㐿⊒⠪ߩ⽶ᜂ߇ᄢ߈޿㧘ߣ޿ߞߚᒙὐ߇޽ࠆ‫ޕ‬㧞㧚㐿⊒⋡⊛ߣߔࠆ⥄ᓞಽᢔಣℂࠪࠬ࠹ࡓߩ᭎ⷐ㧚⥄ᓞಽᢔಣℂࠪࠬ࠹ࡓ #IGPV5RJGTG ߩ᭎ⷐ㧚 ⥄ᓞಽᢔಣℂࠪࠬ࠹ࡓߣࡕࡃࠗ࡞ࠛ࡯ࠫࠚࡦ࠻ᒰ⎇ⓥቶߢ⁛⥄ߦ㐿⊒ࠍⴕߞߡ޿ࠆ⥄ᓞಽᢔಣℂࠪࠬ⥄ᓞಽᢔಣℂࠪࠬ࠹ࡓߣߪ㧘ࠪࠬ࠹ࡓߩ⁁ᴫߩᄌൻߦ

࠹ࡓ AgentSphere ߢߪ JVM ߩᄌᦝࠍߔࠆߎߣߥߊ㧘ߤࠪࠬ࠹ࡓ⥄り߇⥄ᓞ⊛ߦኻᔕߒߥ߇ࠄಽᢔಣℂࠍⴕ߁ࠪߩࠃ߁ߥࡊࡠࠣ࡜ࡓߦኻߒߡ߽㧘࠰࡯ࠬࠦ࡯࠼ਛߩછᗧࠬ࠹ࡓߢ޽ࠆ‫⥄ߩࡓ࠹ࠬࠪޕ‬ᓞᕈࠍḩߚߔߚ߼ߦߪ㧘ࠪߩ૏⟎ߦ⒖േ๮઎ࠍ⸥ㅀߔࠆߛߌߢ㧘⒖േࠍⴕ޿㧘⒖േ

ࠬ࠹ࡓౝߢേߊฦ࠰ࡈ࠻࠙ࠚࠕ߇㧘ઁ߆ࠄߩࡔ࠶࠮࡯ࠫ೨߆ࠄߩಣℂࠍ⛮⛯ߐߖࠆߎߣ߇಴᧪ࠆ㧘ᒝࡑࠗࠣ࡟࡯ߦᔕߓߚⴕേߣ㧘⥄ࠄขᓧߒߚᄖㇱߩᖱႎߦᔕߓߡ್ᢿ࡚ࠪࡦൻࡕࡃࠗ࡞ࠛ࡯ࠫࠚࡦ࠻ࠪࠬ࠹ࡓࠍታ⃻ߒߡ޿ࠍⴕ޿㧘ߘߩ⚿ᨐߦࠃߞߡⴕേࠍ⸘↹ߒ㧘ߘߩ⸘↹ߦၮࠆ‫ޕ‬ߠ߈ⴕേߢ߈ࠆᔅⷐ߇޽ࠆ‫⎇ᧄߢߎߘޕ‬ⓥߢߪ㧘⥄ᓞಽߎߩߎߣߦࠃࠅ㧘ᒰ⎇ⓥቶߩ⥄ᓞಽᢔಣℂࠪࠬ࠹ࡓߢ

ᢔಣℂࠪࠬ࠹ࡓࠍታ⃻ߔࠆߦ޽ߚߞߡ㧘ࡕࡃࠗ࡞ࠛ࡯ࠫ⋡⊛ߣߒߡ޿ࠆ‫ޟ‬ಽᢔಣℂߩᚻᴺߦߟ޿ߡ⹦ߒߊߥ޿ੱ㧙㧙ߢ߽◲නߦಽᢔಣℂߩᕲᕺ߇ฃߌࠄࠇࠆࠪࠬ࠹ࡓ‫ߢޠ‬㧘ࠆߎߣߦࠃࠅ㧘ࡊࡠࠣ࡜ࡓࠦ࡯࠼ߦട߃㧘ࡅ࡯ࡊ㗔ၞౝ‫ޟ‬᭽‫ߥޘ‬⒳㘃ߩࡊࡠࠣ࡜ࡓࠍታⴕน⢻ߥ᳢↪ᕈߩ㜞޿ࠪߩᖱႎࠍታⴕ⁁ᘒߣߒߡ଻ሽߒߡ⒖േߔࠆߎߣ߇น⢻ߣࠬ࠹ࡓ‫ߩޠ‬ቢᚑࠍ⋡ᜰߒߡ޿ࠆ‫ޕ‬ߥߞߡ޿ࠆ‫࠭ࠗ࡜ࠕ࡝ࠪߒ߆ߒޕ‬ᯏ⢻ߪ㧘ࠬ࠲࠶ࠢ㗔ၞౝߩᖱႎ߿ࡊࡠࠣ࡜ࡓࠞ࠙ࡦ࠲ࠍታⴕ⁁ᘒߣߒߡ଻ሽߔ

㧟㧚ᣢሽߩ⒖േ๮઎ߦኻߔࠆᒝൻ

ࠆᯏ⢻ࠍឭଏߒߡ޿ߥ޿‫ޕ‬ᒝࡑࠗࠣ࡟࡯࡚ࠪࡦࠪࠬ࠹ࡓߩታ⃻ߦߪ㧘ࡊࡠࠣ࡜ࡓࠦ࡯࠼㧘ࡅ࡯ࡊ㗔ၞౝߩᖱႎߦ㧚 ⒖േ๮઎ OKITCVG ߩਇ⿷ㇱಽߦߟ޿ߡ

ട߃㧘ߎࠇࠄߩᖱႎߦߟ޿ߡ߽ᔅⷐߥߚ߼㧘ࠬ࠲࠶ࠢ㗔 ᧄ⎇ⓥߢឭ᩺ߔࠆߩߪ㧘࡙࡯ࠩ߇ࠛ࡯ࠫࠚࡦ࠻ߦ⒖േ

ၞౝߩᖱႎ߿ࡊࡠࠣ࡜ࡓࠞ࠙ࡦ࠲⋧ᒰߩᖱႎߩขᓧ߇ᔅ

๮઎ߢ޽ࠆ migrate ࡔ࠰࠶࠼ࠍ⸥ㅀߔࠆߛߌߢ㧘ಣℂߩⷐߣߥࠆ‫⎇ᧄޕ‬ⓥߢߪᣢߦ㧘ࠬ࠲࠶ࠢ㗔ၞౝߩᖱႎߦߟ

ਛᢿ㧘⒖േ㧘ౣ㐿ࠍน⢻ߦߔࠆߎߣߢ޽ࠆ‫ޕ‬ಣℂߩਛᢿ޿ߡߪ㧘JVM ߦᮡḰߢታⵝߐࠇߡ޿ࠆ JPDA ࠍ೑↪ߒᤨߦߪ㧘⒖േߒߚᓟߩㅜਛ߆ࠄߩౣ㐿ߦᔅⷐߥታⴕᤨ࠺ߡ㧘ࠬ࠲࠶ࠢ㗔ၞౝߩࡠ࡯ࠞ࡞ᄌᢙࠍขᓧߒ㧘߹ߚࡊࡠ࡯࠲ࠍขᓧߒߡ޿ࠆ‫ޕ‬ᓥ᧪ߩ migrate ࡔ࠰࠶࠼ߢߪ㧘ࡊࠣ࡜ࡓࠞ࠙ࡦ࠲⋧ᒰߩᖱႎߦߟ޿ߡߪ㧘ࡊࡠࠣ࡜ࡓࠞ࠙࡝ࡒ࠹ࠖࡉဳ㧘String ဳߘߒߡߘࠇࠄߩ㈩೉ဳߩขᓧ࡮ࡦ࠲ࠍ૶ࠊߥߊߡ߽࠰࡯ࠬࠦ࡯࠼ᄌ឵ࠍⴕ߁ߎߣߦࠃߞᓳర߇಴᧪ߡ޿ߚ‫ߒ߆ߒޕ‬㧘ෳᾖဳߩขᓧ࡮ᓳర߇಴᧪

ߡ㧘⒖േᓟߦಣℂࠍਛᢿߒߚ႐ᚲߢ߹ߕ⒖േ೨ߦขᓧߒ

ߡ߅ࠄߕ㧘ࠢ࡜ࠬࠍ೑↪ߒߚࡊࡠࠣ࡜ࡓࠍ⸥ㅀߢ߈ߥ޿ߚࡠ࡯ࠞ࡞ᄌᢙߩᓳరࠍߒ㧘ታⴕࠍౣ㐿ߔࠆߎߣ߇಴᧪ߣ޿߁೙㒢߇޽ߞߚߚ߼㧘ෳᾖဳߩขᓧ࡮ᓳరߦߟ޿ߡࠆࠃ߁ߦߒߚ‫ޕ‬ࠛ࡯ࠫࠚࡦ࠻ߪ㧘ࠬ࡟࠶࠼਄ߢታⴕߐࠇࠆ‫ߢߎߘޕ‬㧘ታⵝࠍⴕߞߚ‫ޕ‬

JPDA ࠍ↪޿ߡࠛ࡯ࠫࠚࡦ࠻߇ታⴕߐࠇߡ޿ࠆࠬ࡟࠶࠼㧚 ࡠ࡯ࠞ࡞ᄌᢙߩขᓧߦߟ޿ߡߦࠕࠢ࠮ࠬߒ㧘ࠬ࠲࠶ࠢౝߩࡠ࡯ࠞ࡞ᄌᢙߩ୯ࠍขᓧߔ ࡠ࡯ࠞ࡞ᄌᢙߩขᓧߩ⺑᣿ߩߚ߼ߦ㧘ೋ߼ߦ JVM ߩࠆ‫ߒ߆ߒޕ‬㧘ߎߩࡠ࡯ࠞ࡞ᄌᢙߩ୯ߪ JPDA ․᦭ߩࠢ࡜࿑㧟㧚㧝ߢ␜ߔࠃ߁ߦ㧘ࠬ࡟࠶࠼Ფߦഀࠅᒰߡࠄࠇࠆ PCࡑࠪࡦᄖㇱ߳ᜬߜ಴ߒ಴᧪ߥ޿‫ߢߎߘޕ‬㧘ߎߩ୯ࠍࠪ࡝ࡔࡕ࡝᭴ㅧߦߟ޿ߡ⺑᣿ߔࠆ‫ޕ‬JVM ߩࡔࡕ࡝᭴ㅧߪ㧘࡟ࠫࠬ࠲ߣ Java ઒ᗐࡑࠪࡦ࡮ࠬ࠲࠶ࠢ㧘JVM Ფߦ߭ߣ

ࠬ Value ဳ ߣߥߞߡ޿ࠆߚ߼㧘ࠪ࡝ࠕ࡜ࠗ࠭಴᧪ߕ㧘ࠕ࡜ࠗ࠭น⢻ߥᄌᢙߦᄌ឵ߒ㧘ࡅ࡯ࡊ㗔ၞౝߦᩰ⚊ߔࠆ‫ޕ‬ߟഀࠅᒰߡࠄࠇࠆࡅ࡯ࡊ㗔ၞߦᄢ೎ߐࠇࠆ‫ޕ‬ߘ߁ߔࠆߎߣߢ㧘JVM ࠍᄌᦝߔࠆߎߣߥߊ㧘Java ߦ஻ࠊߞߡ޿ࠆࠪ࡝ࠕ࡜ࠗ࠭ᯏ⢻ߩߺࠍ↪޿ߡታⴕࠦ࡯࠼㗔ၞ࡮ࡅ࡯ࡊ㗔ၞߘߒߡࠬ࠲࠶ࠢ㗔ၞౝߩࡠ࡯ࠞ࡞ᄌᢙࠍ
PC

䉴䊧䉾䊄䋲䊧䉳䉴䉺䊧䉳䉴䉺Java઒ᗐ
䊙䉲䊮䉴䉺䉾䉪

Java઒ᗐ
䊙䉲䊮䉴䉺䉾䉪

䉴䊧䉾䊄䋱

PC

䊐䊧䊷䊛6
଻ሽߒ㧘೎ࡑࠪࡦߦㅍାߔࠆߎߣ߇ߢ߈ࠆࠃ߁ߦߥࠆ‫ޕ‬䊐䊧䊷䊛5䉥䊕䊤䊮䊄䉴䉺䉾䉪⋥೉ൻ䈚䈩೎䊙䉲䊮䈻⒖േ

䊐䊧䊷䊛4䊨䊷䉦䊦ᄌᢙ䊐䊧䊷䊛3䉴䉺䉾䉪䊐䊧䊷䊛䊐䊧䊷䊛2䊍䊷䊒㗔ၞ䊜䉸䉾䊄㗔ၞ㽲䊐䊧䊷䊛1Java઒ᗐ䊙䉲䊮䉴䉺䉾䉪

JVM䉴䉺䉾䉪JPDAValueဳ
Valu ဳ࿑  ,8/ ߩࡔࡕ࡝᭴ㅧ㽳䊍䊷䊒㗔ၞ JVM ߪࠬ࡟࠶࠼ߣ޿߁න૏ߢࠕࡊ࡝ࠤ࡯࡚ࠪࡦߦ࡝䊨䊷䉦䊦ᄌᢙ⟲䊨䊷䉦䊦ᄌᢙ⟲࠰࡯ࠬࠍഀࠅᒰߡࠆ‫⿠߇࠼࠶࡟ࠬߩߎޕ‬േߔࠆߣ㧘JVM ߪ⥄ಽߩࡔࡕ࡝᭴ㅧౝߦ Java ઒ᗐࡑࠪࡦ࡮ࠬ࠲࠶ࠢࠍഀࠅᒰߡࠆ‫ޕ‬Java ઒ᗐࡑࠪࡦ࡮ࠬ࠲࠶ࠢߪ㧘C ⸒⺆⋥೉ൻน⢻䊂䊷䉺⋥೉ൻน⢻䊂䊷䉺⋥೉ൻน⢻䊂䊷䉺㽴 ⋥೉ൻน⢻䊂䊷䉺࿑  ࡠ࡯ࠞ࡞ᄌᢙߩขᓧߩࡊࡠ࠮ࠬߩࠃ߁ߥᓥ᧪߆ࠄ޽ࠆ⸒⺆ߦ߅ߌࠆࠬ࠲࠶ࠢߦ⋧ᒰߔࠆ߽ߩߢ޽ࠅ㧘ᓟ౉ࠇవ಴ߒߩᓙߜⴕ೉ Stack ߢታ⃻ߐ࿑㧟㧚㧞ߦࡠ࡯ࠞ࡞ᄌᢙߩขᓧߩࡊࡠ࠮ࠬߦߟ޿ߡ␜ࠇߡ޿ࠆ‫ࠢ࠶࠲ࠬޕ‬਄ߩ࠺࡯࠲ߩන૏ࠍࠬ࠲࠶ࠢࡈ࡟࡯ߔ‫ޕ‬ࡓߣ๭߮㧘ߘߩࡈ࡟࡯ࡓߦኻᔕߔࠆࡔ࠰࠶࠼ߩࡠ࡯ࠞ࡞ ࠬ࠲࠶ࠢࡈ࡟࡯ࡓߪਛりߣߒߡⶄᢙߩࡠ࡯ࠞ࡞ᄌᢙࠍ

ᄌᢙߩ㈩೉߿㧘ࠝࡍ࡜ࡦ࠼ࠬ࠲࠶ࠢߥߤࠍ଻ᜬߔࠆ‫ޕ‬ᜬߞߡ޿ࠆ‫ࠄ߆ࡓ࡯࡟ࡈࠢ࠶࠲ࠬߩߘޕ‬ฦࡠ࡯ࠞ࡞ᄌᢙ

Java ⸒⺆ࠍ↪޿ߡࡕࡃࠗ࡞ࠛ࡯ࠫࠚࡦ࠻ࠍታⵝߔࠆ

ࠍขᓧߒߚ߽ߩ߇ Value ဳߩ࠺࡯࠲ߢ޽ࠆ‫࡝ࠪࠍࠇߎޕ‬㓙㧘Java ⸒⺆ߦ஻ࠊߞߡ޿ࠆࠪ࡝ࠕ࡜ࠗ࠭ᯏ⢻ࠍ↪޿ࠕ࡜ࠗ࠭ߔࠆ߹ߢߩᵹࠇߦߟ޿ߡ㧘int ဳߩࡠ࡯ࠞ࡞ᄌ㧙㧙ᢙߩขᓧ࡮ᓳరࠍ଀ߦߒߡ㧘࿑㧟㧚㧞ߣ࠰࡯ࠬࠦ࡯࠼ࠍᢙ৻ߟ৻ߟߦߟ޿ߡ⺞ߴߡⴕߊᔅⷐ߇޽ࠆ‫ޕ‬↪޿ߡ⺑᣿ߔࠆ‫ޕ‬࿑㧟㧚㧡ߪࠬ࠲࠶ࠢࡈ࡟࡯ࡓ߆ࠄขᓧߒߚࡠ࡯ࠞ࡞ᄌ ࠬ࠲࠶ࠢࡈ࡟࡯ࡓ߆ࠄᖱႎࠍขᓧߔࠆ㓙ᔅⷐߥᖱႎߣᢙ߇ෳᾖဳߩ႐วߩേ૞ࠍ␜ߒߡ޿ࠆ‫ߕ߹ޕ‬࿑㧟㧚㧡ߩߒߡ㧘ࠬ࠲࠶ࠢࡈ࡟࡯ࡓߘߩ߽ߩߩ࠺࡯࠲ StackFrameԛߢ int ဳห᭽ߦෳᾖဳࠍขᓧߔࠆ‫⃻ߡߒߘޕ‬࿷ߩෳᾖဳߩဳࠍขᓧߒ㧘ෳᾖဳߩᄌᢙ obj ߣ obj ߩဳ㧘ߘߒߡߣࠬ࠲࠶ࠢࡈ࡟࡯ࡓ߆ࠄࠕࠢ࠮ࠬ಴᧪ࠆࡠ࡯ࠞ࡞ᄌᢙߦ
ߟ޿ߡߩ࡝ࠬ࠻ localValues ߇޽ࠆ‫ޕ‬obj ߩฬ೨ࠍᒁᢙߣߒߡ orscan ࡔ࠰࠶࠼ࠍ๭߮಴ߔ‫ޕ‬ ࠕࠢ࠮ࠬ಴᧪ࠆࡠ࡯ࠞ࡞ᄌᢙ࡝ࠬ࠻ localValues ࠍᒁ

if(valueᢙߣߔࠆߎߣߦࠃߞߡ㧘ࡠ࡯ࠞ࡞ᄌᢙ⟲ࠍࠬ࠲࠶ࠢࡈ࡟࡯ࡓ߆ࠄขᓧߒ㧘Map ဳߩᄌᢙ values ߦᩰ⚊ߔࠆ㧔࿑

instanceof ObjectReference){
ObjectReference obj = (ObjectReference)values.get(var);

RerefenceType refType = obj.referenceType();㧟㧚㧟Ԙ-A㧕‫ޕ‬ฦࡠ࡯ࠞ࡞ᄌᢙߪࡠ࡯ࠞ࡞ᄌᢙ࡝ࠬ࠻߆ԛ㧟ԘB㧕‫ߡߒߘޕ‬ฦࡠ࡯ࠞ࡞ᄌᢙߩሽ࿷ᖱႎߢ޽ࠆ var

 orscan(obj,refType,var.name());
 localvalues.add(objectList);name.add(var.name());
 type.add(var.typeName());}߁ߦࡠ࡯ࠞ࡞ᄌᢙߣߒߡ㧘Value ဳߩᄌᢙ value ࠍขᓧ࿑ 㧚 ෳᾖဳࠍขᓧߒࡅ࡯ࡊ㗔ၞߦᩰ⚊ߔࠆࠦ࡯࠼ࠄ Iterator ߢฦࡠ࡯ࠞ࡞ᄌᢙߩሽ࿷ᖱႎߦߟ޿ߡขࠅ಴ߒ㧘LocalVariable ဳߩᄌᢙ var ߣߒߡขᓧߔࠆ㧔࿑㧟㧚ࠍ૶޿ࡠ࡯ࠞ࡞ᄌᢙ⟲ values ߆ࠄ㧘એਅߩࠦ࡯࠼ߩࠃߔࠆ㧔࿑㧟㧚㧟ԘC㧕‫߇ࠇߎޕ‬࿑㧟㧚㧞ߣ࿑㧟㧚㧟ߩԘߢ޽ࠆ‫ޕ‬ Map values = StackFrame.getValues(localValues);㧭 for( Iterator j = localValues.iterator() ; j.hasNext() ;){LocalVariable var = (LocalVariable) j.next();
㧮
Value value = (Value)values.get(var); 㧯  ฦဳߏߣߩേ૞ Ԙ}࿑ 㧚 ࠬ࠲࠶ࠢࡈ࡟࡯ࡓ߆ࠄ8CNWG ဳࠍขᓧߔࠆ߹ߢߩࠦ࡯࠼

XQKForscan(ObjectReference
obj, ReferenceType refType, String s){for(Iterator
i=refType.fields().iterator();i.hasNext();){
if(PrimitiveValue){}Ԝelse if(StringReference){}else if(ObjectReference){ԝ
orscan((ObjectReference)obj.getValue(field),(ReferenceType)fiield.type(),s+”.”+field.name());
 }}} if(value instanceof IntegerValue){

int x = ((IntegerValue)value).value(); ࡅ࡯ࡊ㗔ၞߦᩰ⚊ localvalues.add(x);name.add(var.name());
type.add(var.typeName());}Ԟ࿑ 㧚 QTUECP ࡔ࠰࠶࠼ߩࠦ࡯࠼ԙ
࿑㧟㧚㧢ߪෳᾖဳࠍ⏕⹺ߒߚࠄ๭߮಴ߐࠇࠆ orscanࡔ࠰࠶࠼ߩࠦ࡯࠼ࠍ␜ߒߡ޿ࠆ‫ޕ‬orscan ࡔ࠰࠶࠼ߪᒁԚ

ᢙߣߒߡ㧘ࠬ࠲࠶ࠢࡈ࡟࡯ࡓ߆ࠄขᓧߒߚࡠ࡯ࠞ࡞ᄌᢙ

obj ߣဳ refType㧘ߘߒߡࠢ࡜ࠬࠍ․ቯߔࠆߚ߼ߩฬ೨ s࿑ 㧚 KPV ဳࠍขᓧߒࡅ࡯ࡊ㗔ၞߦᩰ⚊ߔࠆࠦ࡯࠼ࠍᜬߞߡ޿ࠆ‫ࠄ߆ࡓ࡯࡟ࡈࠢ࠶࠲ࠬޕ‬ขᓧߒߚࡠ࡯ࠞ࡞
ᄌᢙ obj ߦߟ޿ߡ Iterator ߢਛり߇ߥߊߥࠆ߹ߢෳᾖߔ

ߘߒߡ value ߩဳࠍ instanceof ߢ᧦ઙಽጘߒ㧘ฦᄌᢙࠆ‫್ࠍဳ߈ߣߩߘޕ‬೎ߒ㧘ࡠ࡯ࠞ࡞ᄌᢙߩขᓧࠍⴕ߁‫ޕ‬Ფߩേ૞ࠍⴕ߁‫ ߕ߹ޕ‬value ߆ࠄ int ဳߩ୯ࠍขᓧߔࠆ‫ޕ‬ߎࠇ߇࿑㧟㧚㧞ߣ࿑㧟㧚㧠ߩԙߢ޽ࠆ‫ޕ‬ߘߒߡ Vector ဳߩ localvalues㧘name㧘type ߦߘࠇߙߎࠇ߇࿑㧟㧚㧢ߩԜߢ޽ࠆ‫ߡߒߘޕ‬࿑㧟㧚㧢ߩԝߩࠃ߁ߦ㧘ෳᾖဳߩᄌᢙࠍ⏕⹺ߒߚࠄౣ߮ orscan ࡔ࠰࠶࠼ࠍ๭߮಴ߒ㧘ౣᏫ⊛ߦขᓧߒߡⴕߊߎߣߢ㧘ࠢ࡜ࠬߩౝㇱߦࠢ࡜ࠬ߇޽ߞߡ߽ขᓧࠍน⢻ߣߒߚ‫ޕ‬ࠇขᓧߒߚ୯㧘ฬ೨㧘ဳࠍㅊടߔࠆߎߣߢࡅ࡯ࡊ㗔ၞߦᩰ⚊ߒߡ޿ࠆ‫߇ࠇߎޕ‬࿑㧟㧚㧞ߣ࿑㧟㧚㧠ߩԚߢ޽ࠆ‫ޕ‬ߎߩ㓙ᒁᢙߣߒߡ㧘ᱷࠅߩࡠ࡯ࠞ࡞ᄌᢙ㧘ဳ㧘ߘߒߡ

ߎߩ Vector ဳߩ localvalues㧘name㧘type ߪ㧘ࡠ࡯ࠞ࡞ฬ೨ࠍᔅⷐߣߔࠆ߇㧘ฬ೨ߪరߩᒁᢙߩฬ೨ String s ߦᄌᢙขᓧᓟߪ㧘ࠬ࠲࠶ࠢࡈ࡟࡯ࡓ߆ࠄขᓧߒߚోࡠ࡯ࠞ⃻࿷ߩෳᾖဳߩฬ೨ࠍߟߌࠆߎߣߢ৻ᗧߥ߽ߩߦߔࠆߎ࡞ᄌᢙߦߟ޿ߡᩰ⚊ߒߡ޿ࠆ‫ޕ‬ߣ߇಴᧪ࠆ‫ ࠬ࡜ࠢ߫߃଀ޕ‬s1 ߩᄌᢙ i ߢ޽ࠇ߫ s1.i㧘ࠢ࠹ࠖࡉဳߥߤߩࠃ߁ߦ࿑㧟㧞ߣ࿑㧟㧠ߩԙߢ␜ߒߚ

orscan((ObjectReference)obj.getValue(field),(ReferenceType)field.type(), s + ”.” + field.name());
ෳᾖဳࠍ⋥೉ൻߢ߈ࠆᒻߢ࡝࠲࡯ࡦߔࠆࡔ࠰࠶࠼߇ߥ޿‫ޕ‬ߘߩߚ߼㧘ࠢ࡜ࠬᄌᢙߩౝㇱࠍ⿛ᩏߒߡ޿߈㧘ౝㇱߩᄌෳᾖဳߦߟ޿ߡ߽ห᭽ߦขᓧߔࠆ߇㧘ෳᾖဳߪࡊ࡝ࡒ㧙㧙࿑ 㧚 QTUECP ࡔ࠰࠶࠼ߩᒁᢙߩࠦ࡯࠼࡜ࠬ s1 ߩࡈࠖ࡯࡞࠼ߣߒߡሽ࿷ߔࠆࠢ࡜ࠬ s2 ߩᄌᢙd ߢ޽ࠇ߫ s1.s2.d ߣ޿߁ࠃ߁ߦߥߞߡ޿ࠆ‫ޕ‬ขᓧߒߚࠢ࡜ࠬᄌᢙߪ Vector ဳߩ㈩೉ objectList ߦᩰ⚊ߐࠇࠆ‫ޕ‬࿑㧟㧤ߩࠃ߁ߥ᭴ㅧߣߥߞߡ޿ࠆ‫ޕ‬

objectList ߪߘࠇߙࠇ╙  ⷐ⚛߇ᄌᢙߩ୯㧘╙  ⷐ⚛߇ᄌᢙߩ৻ᗧߦ್ᢿߢ߈ࠆฬ೨㧘╙  ⷐ⚛߇ᄌᢙߩဳߣߥ

ߞߡ޿ࠆ‫ޕ‬ objectList[0]objectList[1]objectList[2]ฬ೨
s1.i
s1.s2.dဳ
intdouble



୯
 3
 2.54{࿑  ขᓧߒߚࠢ࡜ࠬᄌᢙߩ᭴ㅧ

 ߘߒߡోߡߩෳᾖဳߩ୯ࠍขᓧߒ⚳ࠊߞߚࠄ㧘࿑㧟㧚㧡ߩԞߦᦠ޿ߡ޽ࠆㅢࠅઁߩဳߣห᭽㧘 Vector ဳߩ

localvalues㧘name㧘type ߦߘࠇߙࠇขᓧߒߚ୯ߢ޽ࠆ}}SampleClass s1;ት⸒ SampleClass s1;if(MigFlag
if(MigFlag ==== false){false){ಣℂ⟲Aಣℂmigrate();}else{}else{
s1.buildClassValue();
s1.buildClassValue();
䊨䊷䉦䊦ᄌ
MigFlag = false;
}}
ಣℂ⟲
B
ಣℂ B

/*SampleClass*/{int i;
SampleClass2 s2;buildClassValue (){i=getClassValue();s2.buildClassValue();
}}/*SampleClass2*/
{
double d;
buildClassValue(){d=getClassValue();}} ࿑ 㧚 IGV%NCUU8CNWG ߣ DWKNF%NCUU8CNWG ߩ⸥ㅀ૏⟎ObjectList㧘ฬ೨㧘ဳࠍㅊടߔࠆߎߣߢࡅ࡯ࡊ㗔ၞߦᩰߘߒߡ SampleClass2⚊ߒ㧘ࠪ࡝ࠕ࡜ࠗ࠭น⢻ߦߒߡ޿ࠆ‫ޕ‬s2 ߢߪࡈࠖ࡯࡞࠼ߢ޽ࠆ d ߩᓳర߇ᔅⷐߢ޽ࠆ‫ޕ‬d ߪෳᾖဳߢߪߥ޿ߩߢ

getClassValue ߢ୯ࠍᓳరߔࠆ‫ޕ‬㧚 ෳᾖဳߩᓳరߦߟ޿ߡ ᓳరߦߟ޿ߡߪ㧘getClassValue ෸߮ buildClassValue߇ታⴕߐࠇࠆߎߣߢࠢ࡜ࠬᄌᢙߩᓳర߇น⢻ߣߥ‫ߩߎޕ‬㧠㧚ࠛ࡯ࠫࠚࡦ࠻ߩ⥄Ꮖࡃ࠶ࠢࠕ࠶ࡊᯏ᭴ߩታⵝ

getClassValue ෸߮ buildClassValue ߪ migrate ↪ߩࠦ࡯࠼ᄌ឵ᤨߦ⥄േᝌ౉ߐࠇࠆ‫ޕ‬㧚 ⥄Ꮖࡃ࠶ࠢࠕ࠶ࡊᯏ᭴ߦߟ޿ߡߩ᭎ⷐ

ෳᾖဳߩᓳరߪᄌᢙ࡝ࠬ࠻ࠍరߦⴕࠊࠇࠆ‫࡜ࠢࠆ޽ޕ‬ㅢᏱ㧘ಽᢔಣℂߢߪⶄᢙߩࡑࠪࡦߦ࠲ࠬࠢࠍಽᢔߐߖ

ࠬ A ౝߦࠢ࡜ࠬ B ߩࠝࡉࠫࠚࠢ࠻߇޽ࠆ႐ว㧘ࠢ࡜ࠬࠆߎߣߢ㧘㜞ା㗬ᕈ߿⠴㓚ኂᕈ߇ᦼᓙߐࠇࠆ‫ߒ߆ߒޕ‬ಽA ߦߪࠢ࡜ࠬᄌᢙౝㇱࠍᓳరߔࠆߚ߼ߩ

ᢔߐߖߡ⚿ᨐࠍ⛔วߔࠆߛߌߢߪ໧㗴߇⊒↢ߔࠆ‫ࠇߘޕ‬buildClassValue ߇ᝌ౉ߐࠇࠆ‫ ࠬ࡜ࠢߡߒߘޕ‬B ߦߪߪฦࡑࠪࡦ߇࠲ࠬࠢಽᢔᤨߩᕈ⢻ߢേ૞ߒߡ޿ࠆߣߪ㒢buildClassValue ߩࡔ࠰࠶࠼ᧄ૕߇ᝌ౉ߐࠇࠆ‫ߪࠇߎޕ‬ࠄߥ޿ߚ߼㧘ೋᦼಽᢔߢᦨㆡߥ⽶⩄ಽᢔࠍⴕߞߡ޿ߚߣ

ࠢ࡜ࠬౝㇱߦෳᾖဳߩᄌᢙ߇޽ࠆ㒢ࠅౣᏫ⊛ߦⴕࠊࠇࠆ‫ޕ‬ߒߡ߽㧘ߘߩᓟߩࡑࠪࡦᕈ⢻ߩᄌൻߦࠃࠅᦨㆡߢߪߥߊ

ߘߒߡෳᾖဳએᄖߩᄌᢙ߇޽ߞߚ႐วߪ㧘ߥߞߡߒ߹߁‫⁁ߩߎޕ‬ᘒߢಣℂࠍ⛯ߌߡ޿ߌ߫ಣℂᤨ㑆

getClassValue ߢ୯ࠍขᓧߔࠆ‫ޕ‬࿑㧟㧚㧥ߪ࿑㧟㧚㧤ߩ߇Ⴧടߒߡߒ߹߁ߛߌߢߥߊ㧘ᦨᖡ⽶⩄߇ដ߆ࠅ⛯ߌߚࠢ ࡜ ࠬ ᄌ ᢙ ߩ ᭴ ㅧ ߦ ᓥ ߞ ߡ getClassValue ߣࡑࠪࡦ߇࠳࠙ࡦߒߡߒ߹޿㧘ߘࠇ߹ߢߘߩࡑࠪࡦߢⴕߞ

buildClassValue ߩ⸥ㅀ૏⟎ߦߟ޿ߡ␜ߒߚ߽ߩߢ޽ߡ޿ߚ⸘▚ಣℂ߇ή㚝ߦߥߞߡߒ߹߁ߎߣ߽⠨߃ࠄࠇࠆ‫ޕ‬ࠆ‫ޕ‬ߘߎߢಣℂࠍ޽ࠆ⒟ᐲⴕߞߚߣ߈ߦߘࠇ߹ߢߩታⴕ࠺࡯ SampleClass s1 ߢ ߪ 㧘 ⥄ り ߩ ᓳ ర ߩ ߚ ߼࠲߽฽߼ߡࠛ࡯ࠫࠚࡦ࠻⥄りߩࡃ࠶ࠢࠕ࠶ࡊࠍ૞ᚑߒ㧘s1.buildClassValue();߇ᝌ౉ߐࠇ㧘ߘߩ๭߮಴ߒߩਛߢߘࠇࠍ೎ࡑࠪࡦ߳ㅍࠅㄟࠎߢ߅ߊ‫ోࡓ࠹ࠬࠪޕ‬૕ߩࡑࠪဳߢߪߥ޿ߩߢ getClassValue ߢ୯ࠍᓳరߔࠆ‫ޕ‬s2 ߪෳࡦߩ⽶⩄߇ᄢ߈ߊߥࠅߘߩࡑࠪࡦߢࠛ࡯ࠫࠚࡦ࠻߇ಣℂ

ࡈࠖ࡯࡞࠼ߢ޽ࠆ i ߣ s2 ߩᓳర߇ᔅⷐߢ޽ࠆ‫ޕ‬i ߪෳᾖᾖ ဳ ߥ ߩ ߢ 㧘 SampleClass s2 ߩ ᓳ ర ߩ ߚ ߼ࡦ⁁ᴫߩ⋙ⷞࠍߔࠆ Scheduler ࠍ↪ᗧߔࠆߎߣߢ㧘ࡑࠪߒ⛯ߌࠆߩ߇࿎㔍ߦߥߞߚᤨ߿㧘ਁ߇৻㧘రߩࠛ࡯ࠫࠚ

s2.buildClassValue();߇ᝌ౉ߐࠇࠆ‫ޕ‬ࡦ࠻߇ᄬࠊࠇߚᤨߦߪ㧘೎ࡑࠪࡦߦㅍࠅㄟ߹ࠇߡ޿ߚࡃ࠶ࠢࠕ࠶ࡊࠛ࡯ࠫࠚࡦ࠻ߦࡃ࠶ࠢࠕ࠶ࡊᤨὐ߆ࠄߩታⴕࠍౣ㐿ߐߖࠆߎߣ߇಴᧪㧘㜞ା㗬ᕈ߿⠴㓚ኂᕈߩะ਄ࠍ⷗ㄟ߻ߎߣ߇಴᧪ࠆ‫ޕ‬㧙㧙ߖࠆߎߣߦߔࠆ‫ޕ‬ߘߎߢ㜞ା㗬ᕈ߿⠴㓚ኂᕈߩะ਄ࠍ⋡⊛ߣߒߚࠛ࡯ࠫࠚࡦ࠻ߩ⥄Ꮖࡃ࠶ࠢࠕ࠶ࡊᯏ᭴ߦߟ޿ߡឭ᩺ߔࠆ‫࡯ࠛޕ‬੹ᓟ㧘Scheduler ࠍ↪ᗧߔࠆߎߣߢ㧘⽶⩄߇ᄢ߈ߊߥࠫࠚࡦ࠻ߩ⥄Ꮖࡃ࠶ࠢࠕ࠶ࡊᯏ᭴߇ሽ࿷ߔࠆߎߣߢ㧘ታࠅಣℂࠍ⛯ߌࠆߩ߇࿎㔍ߦߥߞߚࡑࠪࡦߦ޽ࠆࠛ࡯ࠫࠚⴕ࠺࡯࠲߽฽߼ߚࠛ࡯ࠫࠚࡦ࠻ߩࡃ࠶ࠢࠕ࠶ࡊࠍ૞ᚑߒ㧘ࡦ࠻ࠍ஗ᱛߐߖ㧘೎ࡑࠪࡦߦㅍࠅㄟ߹ࠇߚࡃ࠶ࠢࠕ࠶ࡊ೎ࡑࠪࡦ߳ㅍࠅㄟ߻ߎߣߦࠃࠅ㧘ߘࠇࠄࠍ೑↪ߔࠆߎߣ߆ࠄ஗ᱛߒߚࠛ࡯ࠫࠚࡦ࠻ߩ⛯߈ࠍታⴕߒߚࠅ㧘࠳࠙ࡦߢࡃ࠶ࠢࠕ࠶ࡊᤨὐ߆ࠄಣℂߩౣ㐿߇น⢻ߣߥࠆ‫ޕ‬ߒߡߒ߹ߞߚࡑࠪࡦߦ޽ߞߚࠛ࡯ࠫࠚࡦ࠻ࠍ೎ࡑࠪࡦߢౣ↢ߐߖࠆߎߣߥߤ߇಴᧪ࠆࠃ߁ߦߥࠆ‫ޕ‬੹࿁ߪࡔ࠰࠶࠼߇๭߮಴ߐࠇߚᤨὐߢߩࡃ࠶ࠢࠕ࠶ࡊ
ࠍขᓧߔࠆ backup ࡔ࠰࠶࠼㧘ߘߒߡߘߩ backup ࡔ࠰࠶࠼ࠍ⥄േᝌ౉ߔࠆᚻᴺࠍឭ᩺ߔࠆߎߣߦࠃࠅ㧘ᒝࡑࠗࠣ㧚 DCEMWR ࡔ࠰࠶࠼ߩ⥄േᝌ౉ᚻᴺߩឭ᩺࡟࡯࡚ࠪࡦൻࠛ࡯ࠫࠚࡦ࠻ߩ⥄Ꮖࡃ࠶ࠢࠕ࠶ࡊᯏ᭴ߩታ

 backup ࡔ࠰࠶࠼ߪ࡙࡯ࠩ߇છᗧߦᝌ౉ߔࠆߎߣ߽಴ⵝࠍⴕߞߚ‫ޕ‬᧪ࠆ‫⥄ߢࡓ࠹ࠬࠪߒ߆ߒޕ‬േ⊛ߦࠃࠅ⦟޿႐ᚲߢߩࡃ࠶

ࠢࠕ࠶ࡊࠍขߞߡߊࠇࠆ backup ࡔ࠰࠶࠼ߩ⥄േᝌ౉ᯏ㧚 DCEMWR ࡔ࠰࠶࠼ߦߟ޿ߡ⢻߇޽ࠇ࡙߫࡯ࠩߪ⥄േᝌ౉ᯏ⢻ࠍ೑↪ߔࠆߛߌߢ㧘⠴ backup ࡔ࠰࠶࠼ߪ๭߮಴ߐࠇߚᤨὐߢߩታⴕᤨ࠺࡯㓚ኂᕈࠍᜬߟࠛ࡯ࠫࠚࡦ࠻ࠍ೑↪ߢ߈ࠆࠃ߁ߦߥࠆ‫ߘޕ‬࠲ࠍࡃ࠶ࠢࠕ࠶ࡊߒ㧘೎ࡑࠪࡦ߹ߚߪ⥄ࡑࠪࡦ߳ㅍࠅㄟ

ߎߢߎߎߢߪ backup ࡔ࠰࠶࠼ߩ⥄േᝌ౉ᚻᴺߩឭ᩺ࠍ߻‫ߡߞࠃߦߣߎ߁૶ࠍ࠲࡯࠺ࡊ࠶ࠕࠢ࠶ࡃߩߘߡߒߘޕ‬㧘ⴕ߁‫ޕ‬ߘߩᤨὐ߆ࠄߩౣ㐿ࠍน⢻ߣߔࠆ‫ޕ‬ ੹࿁ឭ᩺ߔࠆ backup ࡔ࠰࠶࠼ߩ⥄േᝌ౉ᚻᴺߢߪ㧘 backup ࡔ࠰࠶࠼߽ᓟߢߩታⴕౣ㐿ߩߚ߼ߦ㧘ታⴕᤨ࠺Ბ㓏ߩࡈࠚ࡯࠭ߦಽߌߡ backup ࡔ࠰࠶࠼ߩᦨㆡߥ૏⟎࡯࠲ߩขᓧࠍⴕࠊߥߌࠇ߫ߥࠄߥ޿‫ߚ߹ޕ‬ታⴕౣ㐿ࠍߔࠍតߔߚ߼ߩಽᨆࠍⴕߞߡ޿ࠆ‫ޕ‬ࠆߚ߼ߦ㧘migrate ࡔ࠰࠶࠼ߣห᭽ߦ࿑㧠㧚㧝ߦ␜ߔ࠰ ߹ߕ╙  ࡈࠚ࡯࠭ߢߪ㕒⊛ಽᨆߢࠦ࡯࠼ࠍ⿛ᩏߒ㧘migrate ࡔ࠰࠶࠼ߢߪ⒖േ⋥ᓟߦߘߩࠛ࡯ࠫࠚࡦ࠻ߪታ࠰࠶࠼ࠍᝌ౉ߔࠆ‫⿛ࠍ࠼࡯ࠦߢߎߎޕ‬ᩏߔࠆߚ߼ߦ㧘㕒ⴕࠍౣ㐿ߔࠆ߇㧘backup ࡔ࠰࠶࠼ߪ Scheduler ߥߤ߆ࠄ⊛ಽᨆߩታⵝߦ޽ߚࠅ JavaCC ࠍ೑↪ߒߚ‫ޕ‬JavaCC ߣ๭߮⿠ߎߐࠇߡ㧘ಣℂࠍౣ㐿ߔࠆߎߣߦߥࠆߣ޿߁ὐߩ

ߪ lex/yacc ߩ Java ⸒⺆ߢ㧘ࠨࡦࡑࠗࠢࡠࠪࠬ࠹ࡓ࠭࡯ࠬࠦ࡯࠼ᄌ឵ࠍⴕ߁‫ޕ‬migrate ࡔ࠰࠶࠼ߣ⇣ߥࠆߩߪ㧘ߺߢ޽ࠆ‫ߩ࠻ࡦࠚࠫ࡯ࠛޕ‬ਛߢ backup ࡔ࠰࠶࠼߇ⶄᢙbackup ࡔ࠰࠶࠼ߩ੍⚂૏⟎ߢ޽ࠆ reserved_backup ࡔ߇㐿⊒ߒߚࠝ࡯ࡊࡦ࠰ࡈ࠻ߢ޽ࠆ=?‫ޕ‬࿁ታⴕߐࠇࠆߎߣ߇಴᧪㧘ߘߩㇺᐲ㧘ࠛ࡯ࠫࠚࡦ࠻ߩࡃߘߒߡ╙  ࡈࠚ࡯࠭ߢߪേ⊛ಽᨆߢታ㓙ߦࠦ࡯࠼ࠍታ࠶ࠢࠕ࠶ࡊ߇↢ᚑߐࠇࠆ‫↢ޕ‬ᚑߐࠇߚࠛ࡯ࠫࠚࡦ࠻ߩࡃⴕߒ㧘㕒⊛ಽᨆᤨߦᝌ౉ߐࠇߚ reserved_backup ࡔ࠰࠶࠶ࠢࠕ࠶ࡊ߇⋥೨ߣหߓ AgentSphere ߦ଻▤ߐࠇࠆߣ࠼ߩਛߢ㧘ࠛ࡯ࠫࠚࡦ࠻ߩ㐿ᆎ߆ࠄߩᤨ㑆ࠍ⸘ࠅ㧘ߘߩ߈ߦߪ਄ᦠ߈ߣߥࠅ㧘ᦨᣂߩࡃ࠶ࠢࠕ࠶ࡊ߇ᱷࠆߎߣߦᤨὐߢߩฦᄌᢙߩࠕࠢ࠮ࠬ㗫ᐲߦߟ޿ߡ⺞ߴࠆ‫ߡߒߘޕ‬ߥࠆ‫ޕ‬ߎࠇࠄߩᖱႎࠍ೑↪ߒߡ੍⚂ᝌ౉ߐࠇߡ޿ߚ

reserved_backup ࡔ࠰࠶࠼ߩ߁ߜ㧘ࡃ࠶ࠢࠕ࠶ࡊߩߚ߼ߦታ㓙ߦ૶߁߽ߩߛߌࠍㆡಾߦㆬ߮಴ߒߡ㧘backup ࡔᄌ឵ᓟ䈱䉮䊷䊄䊡䊷䉱䉮䊷䊄
{}{ት⸒ㇱ
ಣℂ⟲Abackup();ಣℂ⟲B}࠰࠶࠼ߦ⟎឵ߔࠆ‫ޕ‬ት⸒ㇱif(CheckFlag == false){ಣℂ⟲Abackup();}else{
䊨䊷䉦䊦ᄌᢙᓳరㇱ
CheckFlag = false;}
ಣℂ⟲Bbackup೨䈱ಣℂએਅߢߪ㧘㕒⊛ಽᨆߣേ⊛ಽᨆߦߘࠇߙࠇ⹦ㅀߔࠆ‫ޕ‬ 㕒⊛ಽᨆ

backupᓟ䈱ಣℂ 㕒⊛ಽᨆߢߪ㧘ࠦ࡯࠼ࠍ⿛ᩏߒ㧘backup ࡔ࠰࠶࠼ߩ੍⚂૏⟎ߢ޽ࠆ reserved_backup ࡔ࠰࠶࠼ࠍᝌ౉ߔࠆ‫ޕ‬

reserved_backup ࡔ࠰࠶࠼ߪታ㓙ߦࡃ࠶ࠢࠕ࠶ࡊࠍขࠆ

ࡔ࠰࠶࠼ߢߪߥߊ㧘േ⊛ಽᨆᤨߦ೑↪ߐࠇࠆࡔ࠰࠶࠼ߢ࿑  DCEMWR ࡔ࠰࠶࠼ߩ࠰࡯ࠬࠦ࡯࠼ᄌ឵޽ࠆ‫ޕ‬ ߎߩ backup ࡔ࠰࠶࠼ߪ⃻Ბ㓏ߢߪ㧘backup ࡔ࠰࠶࠼ ࠛ࡯ࠫࠚࡦ࠻ࠍࡃ࠶ࠢࠕ࠶ࡊߔࠆࠝ࡯ࡃࡋ࠶࠼ࠍ಴ߩ⸥ㅀߐࠇߚࠛ࡯ࠫࠚࡦ࠻ࠍ▤ℂߔࠆ Scheduler ߇↪ᗧ᧪ࠆߛߌዋߥߊߔࠆߦߪࡃ࠶ࠢࠕ࠶ࡊߩ࿁ᢙࠍᷫࠄߒ㧘ߐࠇߡ޿ߥ޿ߚ߼㧘 ┨ߩ⹏ଔߢߪ㧘ᚻേߢౣ㐿ߐߖࠆ߹ߚ  ࿁ߩࡃ࠶ࠢࠕ࠶ࡊߦ㑐ࠊࠆታⴕᤨ࠺࡯࠲ࠍ಴᧪ࠆ

ࠦࡑࡦ࠼ࠍ೑↪ߒߡࡃ࠶ࠢࠕ࠶ࡊࠛ࡯ࠫࠚࡦ࠻ࠍౣ↢ߐߛߌዋߥߊߔࠆᔅⷐ߇޽ࠆ‫߇ࡊ࡯ࠦࠬޕ‬ᷓߌࠇ߫ᷓ޿߶

㧙㧙



ߤ㧘ࠬ࠲࠶ࠢࡈ࡟࡯ࡓᢙ߇Ⴧ߃㧘ขᓧߔࠆᖱႎ㊂߇ᄢ߈㧡㧚⹏ ଔߊߥߞߡߒ߹޿㧘ߘࠇࠄࠍࡃ࠶ࠢࠕ࠶ࡊߒߡᜬߜㆇ߱ߩߪ㧘ࠝ࡯ࡃࡋ࠶࠼߇ᄢ߈ߊߥࠆ‫ࠄ߆ࡊ࡯ࠦࠬߢߎߘޕ‬಴ ߎߎߢߪ੹࿁ⴕߞߚታⵝߦߟ޿ߡ㧞ߟߩേ૞⏕⹺ࠍⴕߚ૏⟎ࠍ reserved_backup ࡔ࠰࠶࠼ߩᝌ౉૏⟎ߣߒߚ‫ޕ‬߁‫⴫ޕ‬㧡㧝ߪ੹࿁ߩ⹏ଔߦ૶↪ߒߚ 9KPFQYU2% ߩ৻߹ߚࡔ࠰࠶࠼๭߮಴ߒߩ⋥ᓟߦ߽ reserved_backup ࡔ࠰ⷩ⴫ߢ޽ࠆ‫ޕ‬࠶࠼ߪᝌ౉ߐࠇࠆ‫߇࠼࠶࠰ࡔߪࠇߘޕ‬๭߮಴ߐࠇࠆߣ㧘⴫  േ૞⏕⹺ߦ૶↪ߒߚࡑࠪࡦ৻ⷩᣂߒ޿ࠬࠦ࡯ࡊߦ౉ࠅ㧘ߘߩࡔ࠰࠶࠼߇⚳ੌߒߡᚯߞߡ

䊙䉲䊮ฬ CPU䉪䊨䉾䉪ᢙ 䊜䊝䊥䊙䉲䊮 A Core 2 Duo 2.13GHz 2.0GB
䊙䉲䊮 B Pentium D 2.80GHz 1.0GBߊࠆߚ߼ߦߪ㧘ᔅߕ㧝ߟߩࠬࠦ࡯ࡊࠍ಴ࠆ߆ࠄߢ޽ࠆ‫ޕ‬ ߽ߒߎߎߢᝌ౉ߐࠇߚ reserved_backup ࡔ࠰࠶࠼߇ᄙ߆ߞߚߣߒߡ߽㧘ߘࠇࠄߪᰴߩേ⊛ಽᨆᤨߦ⛉ࠅㄟ߹ࠇࠆ‫ޕ‬㧚 ࠢ࡜ࠬᄌᢙߩขᓧ࡮ᓳరߣ DCEMWR ࡔ࠰࠶࠼ߦߟ޿ േ⊛ಽᨆߡߩേ૞⏕⹺േ⊛ಽᨆߢߪ㧘㕒⊛ಽᨆ߇⚳ࠊߞߚࠦ࡯࠼ࠍታ㓙ߦታⴕߒ㧘reserved_backup ߇ࠛ࡯ࠫࠚࡦ࠻ߩേ૞㐿ᆎ߆ࠄ ߎߎߢߪࠢ࡜ࠬᄌᢙߩขᓧ࡮ᓳరߣ backup ࡔ࠰࠶࠼ߦߟ޿ߡߩേ૞⏕⹺ࠍⴕ߁‫߼ߚߩߘޕ‬㧘DCEMWR ࡔ࠰࠶ߤߩߊࠄ޿ߩᤨ㑆ߢታⴕߐࠇߡ޿ࠆߩ߆㧘ߘߒߡ

reserved_backup ࡔ࠰࠶࠼ߩᤨὐߢㅢ▚ߤߩߊࠄ޿ߩᄌᢙࠕࠢ࠮ࠬ߇޽ߞߚߩ߆ߦߟ޿ߡߩ࠺࡯࠲ࠍขࠆ‫ޕ‬࠼ࠍᚻേߢ౉ࠇߚࠦ࡯࠼ࠍ↪޿ߚ‫ޕ‬ਅ⸥ࠦ࡯࠼ߪࠢ࡜ࠬ
ࠍ૶ߞߚࠛ࡯ࠫࠚࡦ࠻ߢ㧘೑↪ࠢ࡜ࠬߩౝㇱߦ߽ࠢ࡜ࠬ߇޽ࠆ‫ߡߒߘޕ‬೎ࡑࠪࡦ߳ backup ࡔ࠰࠶࠼ߢታⴕᤨ࠺ ᄌᢙߩࠕࠢ࠮ࠬߦߟ޿ߡߪ㧘ฦᄌᢙߦኻߒ㧘ታ㓙ߦࠛ࡯ࠫࠚࡦ࠻ࠍേ૞ߐߖ JDI ࠍ೑↪ߒߤࠇߛߌࠕࠢ࠮ࠬ߇

࡯࠲ࠍࡃ࠶ࠢࠕ࠶ࡊߒ㧘೎ࡑࠪࡦߢࡃ࠶ࠢࠕ࠶ࡊߐࠇߚ
࠺࡯࠲߆ࠄౣ↢ߔࠆߎߣߢ㧘ࡠ࡯ࠞ࡞ᄌᢙߩขᓧ࡮ᓳర

޽ߞߚ߆ࠍ⷗ࠆߎߣ߇಴᧪ࠆ‫ޕ‬ reserved_backup ࡔ࠰࠶࠼ߪ޽ߊ߹ߢ backup ࡔ࠰࠶࠼ ߩ ੍ ⚂ ૏ ⟎ ߢ ޽ ࠆ ߩ ߢ 㧘 േ ⊛ ಽ ᨆ ᓟ ߦreserved_backup ࡔ࠰࠶࠼ߩ⛉ㄟߺࠍⴕ߁‫ޕ‬߇಴᧪ߡ޿ࠆ߆ࠍ⏕⹺ߒߚ‫ޕ‬ ߎߩࠦ࡯࠼ߪࠢ࡜ࠬ s1 ߩࡈࠖ࡯࡞࠼ i ߣ j ෸߮ࠢ࡜ࠬs1 ߩࡈࠖ࡯࡞࠼ߢ޽ࠆࠢ࡜ࠬ s2 ߩࡈࠖ࡯࡞࠼ d ߩ୯ߦߟ޿ߡ㧘s1 ߩࡔ࠰࠶࠼ valincr()ߢჇടߐߖࠆࡊࡠࠣ࡜੹࿁ߪ৻଀ߣߒߡ㧘⛉ㄟߺࠍⴕ߁᧦ઙࠍ㧞ߟ⠨߃ߚ‫ޕ‬৻ߟ⋡ߩ᧦ઙߪ㧘ฦ reserved_backup 㑆ߩᤨ㑆ߢ್ᢿߔࠆ‫ ߪࠇߎޕ‬reserved_backup ߇⍴ᤨ㑆ߢⶄᢙ࿁ታⴕߐࠇࡓߢ㧘Ⴧടߐߖࠆߚ߮ߦታⴕᤨ࠺࡯࠲ࠍࡃ࠶ࠢࠕ࠶ࡊߒ㧘೎ࡑࠪࡦ߳ㅍࠅㄟߺ㧘ᣂߒ޿ࡃ࠶ࠢࠕ࠶ࡊ߇ฎ޿ࡃ࠶ࠢࠕ࠶ࡊࠍ਄ᦠ߈ߔࠆ߽ߩߢ޽ࠆ‫ޕ‬ߡ޿ߚ႐วߪਇⷐ㧘ߣ್ᢿߔࠆ߽ߩߢ޽ࠆ‫ޕ‬ੑߟ⋡ߩ᧦࿑  ߪ㧘DCEMWR ࡔ࠰࠶࠼߇ᝌ౉ߐࠇߚᄌ឵೨ߩࠦઙߣߒߡㅢ▚ᄌᢙࠕࠢ࠮ࠬ࿁ᢙߩᏅߢ್ᢿߔࠆ߽ߩߢ޽࡯࠼ߢ㧘࡙࡯ࠩ߇⸥ㅀߔࠆߩߪߎࠇߛߌߢ޽ࠆ‫ޕ‬ࠆ߇㧘ታ㓙ߦታⵝߒߡߺߚߣߎࠈ㧘૛ࠅߦ߽ࠝ࡯ࡃࡋ࠶ߎߩᓟ࿑㧡㧚㧝ߩࠦ࡯࠼ߪ࠰࡯ࠬࠦ࡯࠼ᄌ឵ེߦដߌ࠼߇ᄢ߈߆ߞߚߚ߼㧘᧦ઙ߆ࠄᄖߒߚ‫ޕ‬േ⊛ಽᨆਛߦㅢ
ߞ ߚ reserved_backup ࡔ ࠰ ࠶ ࠼ ߩ ૏ ⟎ ߢ 㧘 ߤ ߩreserved_backup ࡔ࠰࠶࠼ࠍㅢߞߚ߆㧘ߘߩ⇟ภߣㅢߞߚ ᤨ 㑆 ࠍ ࡅ ࠬ ࠻ ࡝ ߣ ߒ ߡ ⸥ ㍳ ߒ ߡ ⴕ ߊ ‫ߩ ߘ ߡ ߒ ߘޕ‬ࡅ ࠬ ࠻࡝߆ࠄㆡಾߥ࠲ࠗࡒࡦࠣߢታⴕߐࠇࠆ

reserved_backup ࡔ࠰࠶࠼ࠍㆬ߮಴ߔߎߣ߇಴᧪ࠆ‫ޕ‬ᓥߞߡ㧘reserved_backup ࡔ࠰࠶࠼ࠍߤߩߊࠄ޿ߩ㑆㓒ߢᱷߔߴ߈߆ߦࠃߞߡ㧘↢ᚑߐࠇࠆࡃ࠶ࠢࠕ࠶ࡊࠛ࡯
ࠫࠚࡦ࠻ߩᢙߪᄌࠊߞߡߊࠆ߇㧘ߘࠇߪ੹ߩߣߎࠈ࡙࡯
ࠩ߇ߘߩ㑆㓒ࠍࡄ࡜ࡔ࡯࠲ߣߒߡᜰቯߔࠇ߫⦟޿ߎߣߣ
ߒߚ‫ޕ‬




 public class BackupSampleTest{
private String IPaddress = "133.220.114.108";
 private static AgentCoordinator ac; public void create (){SampleClass s1 = new SampleClass();
 ac = getAgentCoordinator(); for (int i = 0; i < 10; i++){
System.out.println("backup೨䈱୯s1.i:" + s1.i + " s1.j:" +
s1.getj() + " s1.s2.d:" + s1.s2.d); s1.valincr();ac.backup(IPaddress, 0);
Thread.sleep(2000); } System.out.println("backupᓟ䈱୯s1.i:" + s1.i + " s1.j:" +s1.getj() + " s1.s2.d:" + s1.s2.d);}࿑  DCEMWR ࡔ࠰࠶࠼ࠍᝌ౉ߒߚᄌ឵೨ߩࠦ࡯࠼㧙㧙public class Translated_BackupSampleTest{
private String IPaddress = "133.220.114.108";private static AgentCoordinator ac; public void create (){ SampleClass s1 = new SampleClass();
ac = getAgentCoordinator(); if(ac.checkflag(0)==false){ ac = getAgentCoordinator();}else{
 s1.buildClassValue(ac,0); }for (int i = 0;ac.checkflag(0)==true || i < 10; i++){ if(ac.checkflag(0)== false){
 System.out.println("backup೨䈱୯s1.i:" + s1.i + " s1.j:" +s1.getj() + " s1.s2.d:" + s1.s2.d);s1.valincr(); ac.backup(IPaddress, 0);}else{
s1.buildClassValue(ac,0); i = ac.getIntegerValue("i",0); ac.setFlag(0);} Thread.sleep(2000); }System.out.println("backupᓟ䈱୯s1.i:" + s1.i + " s1.j:" +s1.getj() + " s1.s2.d:" + s1.s2.d);
}
}











ࠛ࡯ࠫࠚࡦ࠻ߩ஗ᱛ࿑  ࡑࠪࡦ # ߩታⴕ⚿ᨐ࿑  DCEMWR ࡔ࠰࠶࠼ࠍᝌ౉ߒߚᄌ឵ᓟߩࠦ࡯࠼

 public class SampleClass {int i;
private double j; SampleClass2 s2;
SampleClass(){ i=1; j=3.0; s2=new SampleClass2();} /*䉪䊤䉴ᄌᢙ↪䈱⥄േᝌ౉䊜䉸䉾䊄*/ public void buildClassValue(AgentCoordinator ac, int rank) {i=(Integer)ac.getClassValue("s1.i", 0); j=(Double)ac.getClassValue("s1.j", 0); s2.buildClassValue(ac,0);}࿑  ࡑࠪࡦ $ ߩታⴕ⚿ᨐࠄࠇࠆ‫ޕ‬ᄌ឵ᓟߩࠦ࡯࠼ࠍ࿑㧡㧞ߦ␜ߔ‫ޕ‬⒖േ๮઎㧔ߎߎߢߪ backup 㧕ߦ㑐ߔࠆᄌ឵ࠍᢳ૕ߢ␜ߒ㧘ߐࠄߦ

backup ↪࿕᦭ߩᄌ឵ࠍਅ✢ㇱߢ␜ߒߡ޽ࠆ‫ߚ߹ޕ‬࿑㧡㧟ߦ࿑㧡㧝ߣ࿑㧡㧞ߢ૶↪ߒߡ޿ࠆࠢ࡜ࠬߩᄌ឵ᓟߩࠦ࡯࠼ࠍ␜ߔ‫ޕ‬ᄌ឵ߐࠇߚㇱಽߪਅ✢ߢ␜ߒߡ޽ࠆ‫ޕ‬એ਄ߩࠦ࡯࠼ࠍ AgentSphere ࠍേ૞ߐߖߡ޿ࠆࡑࠪ
 double getj(){ return j; }

ࡦ A ߢታⴕߒ㧘i ߇  ߦߥߞߚߣߎࠈߢ AgentSphere ࠍ public void valincr() { i++; j++; s2.d++;}}஗ᱛߒ㧘ࠛ࡯ࠫࠚࡦ࠻ࠍ⚳ੌߐߖߚ‫ࡃߪߢߎߎߡߒߘޕ‬public class SampleClass2 { double d;ߒ㧘ࡑࠪࡦ A ߢߩ⛯߈߆ࠄታⴕߐࠇࠆߎߣࠍ⺞ߴߚ‫ߘޕ‬SampleClass2(){ d = 13;}
public void buildClassValue(AgentCoordinator ac, int rank) { d = (Double)ac.getClassValue("s1.s2.d",0);}}࠶ࠢࠕ࠶ࡊߐࠇߚࠛ࡯ࠫࠚࡦ࠻߇⿠േᓟߦಣℂࠍౣ㐿಴᧪ࠆߩ߆ࠍ⏕⹺ߔࠆߚ߼㧘ࡑࠪࡦ B ߢ AgentSphere ߩࡃ࠶ࠢࠕ࠶ࡊߩౣ↢ࠦࡑࡦ࠼ߢ޽ࠆ bc ࠦࡑࡦ࠼ࠍ೑↪
ߩ⚿ᨐࠍ࿑㧡㧠㧘࿑㧡㧡ߦ␜ߔ‫ ࡦࠪࡑޕ‬B ߢౣ㐿ߒߚߣߎࠈ㧘࡞࡯ࡊࠗࡦ࠺࠶ࠢࠬߢ޽ࠆ i ߩ୯෸߮ࠝࡉࠫࠚ
ࠢ࠻ s1 ߩ୯߇ᒁ߈⛮߇ࠇߡ߅ࠅ㧘ࡑࠪࡦ A ߢߩ⛯߈߇

ࡑࠪࡦ B ߢⴕࠊࠇ㧘ࠢ࡜ࠬᄌᢙߦߟ޿ߡขᓧ࡮ᓳరߢ߈
ߡ޿ࠆߎߣ߇ಽ߆ࠆ‫ޕ‬࿑  ࠹ࠬ࠻ߢ೑↪ߔࠆࠢ࡜ࠬߩࠦ࡯࠼㧙㧙 DCEMWR ࡔ࠰࠶࠼ߩ⥄േᝌ౉ᚻᴺߩᱜᒰᕈߩ⹏ଔࠕ࠶ࡊ߇ขࠅ㧘ߘߩ⛯߈߆ࠄߩታⴕ߇಴᧪ߡ޿ߡ㧘ࡃ࠶backup ࡔ࠰࠶࠼ߩ⥄േᝌ౉߇ߤߩࠃ߁ߦⴕࠊࠇߡ޿

ࠢࠕ࠶ࡊ߇᦭ലߢ޽ࠆߎߣࠍ␜ߒߡ޿ࠆ‫ޕ‬ࠆ߆ࠍ⏕⹺ߔࠆߚ߼㧘Ꮌ࿁࠮࡯࡞ࠬࡑࡦ໧㗴㧔એᓟTSP㧕ߩోត⚝ߢߩ⸃ᴺߩࠦ࡯࠼ߦኻߒ⥄േᝌ౉ࠍⴕߞ㧢㧚⚿ ⺰ߚ‫⚿ߩߘޕ‬ᨐ㧘㕒⊛ಽᨆߦࠃߞߡ࿑㧡㧢ߦ␜ߐࠇߡ޿

ࠆࠃ߁ߦ reserved_backup ࡔ࠰࠶࠼߇ᝌ౉ߐࠇߚ‫ޕ‬ฦ ߹ߣ߼reserved_backup ࡔ࠰࠶࠼ߪ⥄ಽߣઁࠍ⷗ಽߌࠆߚ߼ᒁ ᧄ⎇ⓥߢߪ㧘߹ߕᦨೋߦ㧘ᒝࡑࠗࠣ࡟࡯࡚ࠪࡦߩ⒖േ
๮ ઎ migrate ߩ ᯏ ⢻ ߩ ᡷ ⦟ ࠍ ⴕ ߞ ߚ ‫ ޕ‬એ ೨ ߩᢙߣߒߡࠪ࡯ࠤࡦࠪࡖ࡞ߦᢙ୯ࠍᜬߞߡ޿ࠆ‫ޕ‬AgentSphere ߢߪ㧘ࠛ࡯ࠫࠚࡦ࠻߇ migrate ๮઎ߦࠃߞ
public void create() start_re ();//Map↢ᚑ for(i=0;i<NUM;i++){ find(MAP[0][0],1,i);
reserved_backup(1)}
reserved_backup(2)}


void find(intsum,intdepth,intplace){if(sum >reserved_backup(3)check[place]= true;
for(int i = 1 ; i < NUM ; i++){if(check[i] == false){find(sum+MAP[place][i],depth+1,i);
reserved_backup(4)}reserved_backup(5)}reserved_backup(6)if(depth== NUM - 1){
sum += MAP[place][0];if(sum < point){
point = sum;}reserved_backup(7)}reserved_backup(8)check[place]= false;}ߡ⒖േߔࠆ㓙ߪ㧘ࡊ࡝ࡒ࠹ࠖࡉဳߩᄌᢙߣ String ဳߩࠝࡉࠫࠚࠢ࠻ߒ߆଻ሽߒߡ⒖േߔࠆߎߣ߇಴᧪ߥ߆ߞߚ‫ޕ‬ᧄ⎇ⓥߢⴕߞߚࠦ࡯࠼ᄌ឵ᚻᴺߩᡷ⦟ߦࠃࠅ㧘ߎࠇ߹ߢਇน⢻ߢ޽ߞߚࠢ࡜ࠬࠝࡉࠫࠚࠢ࠻߽ขᓧߒߡ⒖േߒ㧘⒖േవߢᓳరߔࠆߎߣ߇น⢻ߣߥߞߚ‫ߪࠩ࡯࡙ߢࠇߎޕ‬ߤߩࠃ߁ߥࠦ࡯࠼ߢ߽ࠛ࡯ࠫࠚࡦ࠻ߣߒߡ⸥ㅀ಴᧪ࠆࠃ
߁ߦߥࠅ㧘᭽‫ߩ⊛⋡ߥޘ‬ಣℂࠍⴕ߁ࡊࡠࠣ࡜ࡓࠍታⴕน⢻ߥࠪࠬ࠹ࡓߦߥߞߚߣ⸒߃ࠆ‫ޕ‬ߐࠄߦᧄ⎇ⓥߢߪ㧘ࠛ࡯ࠫࠚࡦ࠻ߦ⥄Ꮖࡃ࠶ࠢࠕ࠶ࡊᯏ᭴ࠍታⵝߒߚ‫ߡߒߘޕ‬ᚻേߢ⥄Ꮖࡃ࠶ࠢࠕ࠶ࡊ๮઎ߢ
޽ࠆ backup ๮઎ࠍࠛ࡯ࠫࠚࡦ࠻ߦ⸥ㅀߒ㧘ߘߩേ૞ࠍ⏕⹺ߒߚ‫ࠅࠃߦࠇߎޕ‬㧘ࠛ࡯ࠫࠚࡦ࠻ߪታⴕਛߩࡑࠪࡦߢਇ᷹ߩ੐ᘒߦࠃࠅ஗ᱛߒߚ႐วߢ߽㧘ઁߩࡑࠪࡦߦㅍࠅㄟ߹ࠇߚ⥄りߩࡃ࠶ࠢࠕ࠶ࡊࠍേ૞ߐߖࠆߎߣߦࠃࠅ㧘࿑  㕒⊛ಽᨆᓟߩࠦ࡯࠼஗ᱛᤨߦᦨ߽ㄭ޿⁁ᘒ߆ࠄ㧘ಣℂࠍౣ㐿࡮⛮⛯ߔࠆߎߣ߇ߢ߈ࠆࠃ߁ߦߥࠅ㧘ࠛ࡯ࠫࠚࡦ࠻ࠪࠬ࠹ࡓߣߒߡߩ㜞ᦝ ߦ േ ⊛ ಽ ᨆ ࠍ ⴕ ߞ ߚ ⚿ ᨐ 㧘 㧞 㨪 㧤 ߩା㗬ᕈ࡮⠴㓚ኂᕈߩะ਄ࠍ࿑ࠆߎߣ߇಴᧪ߚ‫ߚ߹ޕ‬㧘ߎreserved_backup ࡔ ࠰ ࠶ ࠼ ߪ ⛉ ࠅ ㄟ ߹ ࠇ 㧘 㧝 ߩߩ backup ๮઎ߪ㧘ࠛ࡯ࠫࠚࡦ࠻ࠍ⸥ㅀߔࠆੱ߇ᚻേߢ

reserved_backup ࡔ࠰࠶࠼ߩߺ߇ᱷߞߚ‫ޕ‬㧟㨪㧤ߩ૏⟎ㆡಾߥ႐ᚲߦ౉ࠇࠆߎߣ߇ߢ߈ࠆ߽ߩߢ޽ࠆ߇㧘ᣢሽߩߩ reserved_backup ߪౣᏫࡔ࠰࠶࠼ߢ޽ࠆ find ߩౣᏫ๭ࠛ࡯ࠫࠚࡦ࠻ߩࠦ࡯࠼ߦ backup ๮઎ࠍ⥄േᝌ౉ߔࠆᚻ߮಴ߒ߇⚳ੌߔࠆ㓙ߦ⍴ᤨ㑆ߢታⴕߐࠇࠆ૏⟎ߢ޽ࠅ㧘

ᴺ߽ឭ᩺ߒߚ‫ߪࠇߎޕ‬㧘ࠛ࡯ࠫࠚࡦ࠻ߩࠦ࡯࠼ࠍ㕒⊛ಽࡃ࠶ࠢࠕ࠶ࡊߣߒߡߪㆡߐߥ޿߽ߩ߫߆ࠅ㧘ߣ⠨߃ࠄࠇᨆߣേ⊛ಽᨆߩ㧞ࡈࠚ࡯࠭ߦಽߌߡ⸃ᨆߔࠆߎߣߦࠃࠅ㧘ࠆ‫ߒ߆ߒޕ‬㧝ߩ reserved_backup ߪౣᏫ߇⚳ੌߒ㧘ᚯߞੱ߇ㆡಾߣ⠨߃ࠆࠦ࡯࠼ౝߩ૏⟎㧘ߔߥࠊߜ㧘ߘࠇ߹ߢߡ߈ߡࠬ࠲࠶ࠢࡈ࡟࡯ࡓ߇ᷫߞߡ޿ࠆ႐ᚲߢ޽ࠅ㧘ᄢ㊂ߩಣℂߩㅜਛ⚿ᨐࠍᭂജή㚝ߦߒߥ޿ߢᷣߺ㧘߆ߟࡃ࠶ߩಣℂ߇⚳ࠊߞߚߣ⠨߃ࠄࠇࠆ‫⺰ߪࠇߎޕ‬ℂ⊛ߦ⷗ߡ߽ࠢࠕ࠶ࡊߩ㓙ߩࠛ࡯ࠫࠚࡦ࠻ࠨࠗ࠭ࠍᄢ߈ߊߒߔ߉ߡᄙ

TSP ߢ㧝ߟߩ⚻〝߇ᓧࠄࠇߚ⋥ᓟߦࡃ࠶ࠢࠕ࠶ࡊ૞ᬺᄢߥࠝ࡯ࡃࡋ࠶࠼ߣߥࠄߥ޿ࠃ߁ߥ૏⟎ࠍ⥄േ⊛ߦ⷗ߟࠍⴕ߁ߎߣߦ⋧ᒰߔࠆߩߢ㧘ㆡಾߥࡃ࠶ࠢࠕ࠶ࡊߢ޽ࠆߣ⠨߃ࠄࠇࠆ‫ޕ‬ ߹ߚߎߩಽᨆᓟߩ TSP ߦߟ޿ߡ backup ࡔ࠰࠶࠼߇ᯏߌ಴ߒ㧘backup ๮઎ࠍᝌ౉ߔࠆ߽ߩߢ޽ࠆ‫⥄ߩߎޕ‬േᝌ౉ᯏ⢻ࠍ⏕⹺ߒߚ TSP ⸃ᴺߩࠨࡦࡊ࡞ࠦ࡯࠼ߢߪ㧘ㆡಾߣᕁ߃ࠆ૏⟎ߦᝌ౉ߔࠆߎߣ߇ߢ߈ߚ߇㧘ઁߩ⦡‫ޘ‬⢻ߒߡ޿ࠆߎߣߩ⏕⹺ࠍⴕߞߚ‫ߕ߹ޕ‬ೋ߼ߦ  ㇺᏒߩࡑߥࠦ࡯࠼ߢ߽ㆡಾߥ૏⟎ߦᝌ౉ߢ߈ࠆࠃ߁ߦߔࠆߚ߼ߦ

࠶ࡊࠍ౉ജߣߒߡ TSP ߩಣℂࠍⴕ߁ࠛ࡯ࠫࠚࡦ࠻ࠍ஗ߪ㧘߹ߛ⺞ᢛ߇ᔅⷐߢ޽ࠆߣ⠨߃ߡ޿ࠆ‫ޕ‬ᱛߐߖߕߦᦨೋ߆ࠄᦨᓟ߹ߢⴕߞߚ‫⚿ߩߘޕ‬ᨐ⚂㧡ಽߩᤨ㑆߇ដ߆ߞߚ‫ޕ‬ᰴߦౣ߮ TSP ࠍേ૞ߐߖ㧘⚂㧠ಽߩᤨ ੹ᓟߩዷᦸౣ↢ߒߚߣߎࠈ㧘ᱷࠅߩ⚂  ಽߢᦨ⍴⚻〝ߩ⚿ᨐࠍ಴ജᴺࠍታ⃻ߒߚߎߣߦࠃࠅ㧘AgentSphere ࠪࠬ࠹ࡓߩ⽶⩄ὐߢࠛ࡯ࠫࠚࡦ࠻ࠍ஗ᱛߐߖߚ‫ ߡߒߘޕ‬bc ࠦࡑࡦ࠼ߢߒߚ‫ ߪࠇߎޕ‬backup ࡔ࠰࠶࠼ߢࠛ࡯ࠫࠚࡦ࠻ߩࡃ࠶ࠢ

backup ࡔ࠰࠶࠼߇෸߮ backup ࡔ࠰࠶࠼ߩ⥄േᝌ౉ᚻ▤ℂࠍⴕ߁ Scheduler ࠍ↪ᗧߔࠆߎߣߢ㧘ೋᦼಽᢔߛߌ㧙㧙ߢߥߊౣ⽶⩄ಽᢔࠍⴕ߁ߎߣߢ㧘ࠪࠬ࠹ࡓ߇⥄ᓞ⊛ߦേ૞ߔࠆࠪࠬ࠹ࡓࠍ᭴▽ߔࠆߎߣ߇⠨߃ࠄࠇࠆ‫ޕ‬ෳ⠨ᢥ₂

[1] ↰ਭ଻㓷ବ㧘“ᒝࡑࠗࠣ࡟࡯࡚ࠪࡦࡕࡃࠗ࡞ࠛ࡯ࠫࠚࡦ࠻ࠍታ⃻ߔࠆࠦ࡯࠼ᄌ឵ᚻᴺ”ᚑくᄢቇᄢቇ㒮Ꮏቇ⎇ⓥ⑼ᖱႎಣℂኾ᡹ୃ჻⺰ᢥ㧘2006[2] ᪉੗ᐽ᮸㧘“ᒝࡑࠗࠣ࡟࡯࡚ࠪࡦࡕࡃࠗ࡞ࠛ࡯ࠫࠚࡦ࠻ߩߚ߼ߩ࠰࡯ࠬࠦ࡯࠼ᄌ឵ེߩታⵝ”ᚑくᄢቇᄢቇ㒮Ꮏቇ⎇ⓥ⑼ᖱႎಣℂኾ᡹ୃ჻⺰ᢥ㧘2007[3] ૒⮮৻㇢㧦‫ޟ‬AgentSpace㧦ࡕࡃࠗ࡞ࠛ࡯ࠫࠚࡦ࠻ࠪ
ࠬ࠹ࡓ‫ޠ‬, ᣣᧄ࠰ࡈ࠻࠙ࠚࠕ⑼ቇળ, Dec.1998[4] ᣣᧄ IBM ᧲੩ၮ␆⎇ⓥᚲ㧦

http://www.trl.ibm.com/aglets/, Jan.2009 ෳᾖน[5] ☨Ỉ᣿ᙗ,㑐ญ㦖㇢,ᯅᧄ᡽᦮㧦‫ޟ‬⒖േࠦ࡯࠼ᛛⴚߦၮ
ߠߊࡕࡃࠗ࡞࠰ࡈ࠻࠙ࠚࠕ‫ޠ‬
http://homepage.mac.com/t.sekiguchi/javago/index-j.html, Jan.2009 ෳᾖน[6] 㚂⮮৻ᐘ: http://www.shudo.net/moba/, Jan.2009 ෳᾖน[7] JavaCC㧦https://javacc.dev.java.net/, Jan.2009 ෳᾖน㧙㧙