ALMA Computing Group

Mount6Impl.java

Go to the documentation of this file.
00001 /*
00002  *    ALMA - Atacama Large Millimiter Array
00003  *    (c) European Southern Observatory, 2004
00004  *    Copyright by ESO (in the framework of the ALMA collaboration),
00005  *    All rights reserved
00006  *
00007  *    This library is free software; you can redistribute it and/or
00008  *    modify it under the terms of the GNU Lesser General Public
00009  *    License as published by the Free Software Foundation; either
00010  *    version 2.1 of the License, or (at your option) any later version.
00011  *
00012  *    This library is distributed in the hope that it will be useful,
00013  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  *    Lesser General Public License for more details.
00016  *
00017  *    You should have received a copy of the GNU Lesser General Public
00018  *    License along with this library; if not, write to the Free Software
00019  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
00020  *    MA 02111-1307  USA
00021  */
00022 package alma.ACSCOURSE_MOUNT.Mount6Impl;
00023 
00024 import java.util.concurrent.ThreadFactory;
00025 import java.util.logging.Level;
00026 
00027 import alma.ACS.ROdouble;
00028 import alma.ACS.ROdoubleHelper;
00029 import alma.ACS.ROdoublePOATie;
00030 import alma.ACS.impl.CharacteristicComponentImpl;
00031 import alma.ACS.impl.ROdoubleImpl;
00032 import alma.ACSCOURSE_MOUNT.Mount6J;
00033 import alma.JavaContainerError.wrappers.AcsJContainerServicesEx;
00034 import alma.acs.component.ComponentLifecycleException;
00035 import alma.acs.container.ContainerServices;
00036 import alma.acscourse.xmlbinding.myxmlconfigdata.MyNestedDataT;
00037 import alma.acscourse.xmlbinding.myxmlconfigdata.MyXmlConfigData;
00038 import alma.entities.commonentity.EntityT;
00039 
00044 public class Mount6Impl extends CharacteristicComponentImpl implements Mount6J
00045 {
00046         private ROdouble m_actAz;
00047 //      private DataAccess m_actAzDataAccess;
00048         private ROdouble m_actEl;
00049         private ROdouble m_cmdAz;
00050         private ROdouble m_cmdEl;
00051 
00052         
00053         public void initialize(ContainerServices containerServices) throws ComponentLifecycleException {
00054 
00055                 super.initialize(containerServices);
00056                 
00057                 try
00058                 { 
00059                         ROdoubleImpl actAzImpl = new ROdoubleImpl("actAz", this);
00060 //                      m_actAzDataAccess = actAzImpl.getDataAccess();
00061                         ROdoublePOATie actAzTie = new ROdoublePOATie(actAzImpl);
00062                         m_actAz = ROdoubleHelper.narrow(this.registerProperty(actAzImpl, actAzTie));
00063 
00064                         ROdoubleImpl actElImpl = new ROdoubleImpl("actEl", this);
00065                         ROdoublePOATie actElTie = new ROdoublePOATie(actElImpl);
00066                         m_actEl = ROdoubleHelper.narrow(this.registerProperty(actElImpl, actElTie));
00067 
00068                         ROdoubleImpl cmdAzImpl = new ROdoubleImpl("cmdAz", this);
00069                         ROdoublePOATie cmdAzTie = new ROdoublePOATie(cmdAzImpl);
00070                         m_cmdAz = ROdoubleHelper.narrow(this.registerProperty(cmdAzImpl, cmdAzTie));
00071 
00072                         ROdoubleImpl cmdElImpl = new ROdoubleImpl("cmdEl", this);
00073                         ROdoublePOATie cmdElTie = new ROdoublePOATie(cmdElImpl);
00074                         m_cmdEl = ROdoubleHelper.narrow(this.registerProperty(cmdElImpl, cmdElTie));
00075                 }
00076                 catch (Throwable th)
00077                 {
00078                         throw new ComponentLifecycleException("Failed to create properties.", th); 
00079                 }
00080         }
00081         
00082 
00101         public MyXmlConfigData createMyXmlConfigData()
00102         {
00103                 MyXmlConfigData xmlData = new MyXmlConfigData();
00104                 
00105                 try
00106                 {
00107                         EntityT entity = new EntityT();
00108                         // the next line could be omitted if we had defined a subtype of EntityT in the XML schema, 
00109                         // as it is done in the schemas of module acstestentities
00110                         entity.setEntityTypeName("MyXmlConfigData"); 
00111                         m_containerServices.assignUniqueEntityId(entity);
00112                         xmlData.setMyXmlConfigDataEntity(entity);
00113                         
00114                         // note how we use the type-safe methods: "SomeAttribute" and "MyStringData" are names derived from the schema
00115                         xmlData.setSomeAttribute("great attribute here!");
00116                         xmlData.setMyStringData("string child elements looks like a string attribute when using binding classes...");
00117                         
00118                         MyNestedDataT childData = new MyNestedDataT();
00119                         childData.setSomeOtherData("one more silly string");
00120                         xmlData.setChildData(childData);
00121                         
00122                         // of the possible 0..7 (grand)child elements, we just add 1
00123                         MyNestedDataT grandchildData = new MyNestedDataT();
00124                         childData.addSomeNestedData(grandchildData);
00125                 }
00126                 catch (AcsJContainerServicesEx e)
00127                 {
00128                         m_logger.log(Level.SEVERE, "failed to create ObsProposal. ", e);
00129                 }
00130                 
00131                 return xmlData;
00132         }
00133         
00134         
00135         public ROdouble actAz()
00136         {
00137                 return m_actAz;
00138         }
00139         public ROdouble actEl()
00140         {
00141                 return m_actEl;
00142         }
00143         public ROdouble cmdAz()
00144         {
00145                 return m_cmdAz;
00146         }
00147         public ROdouble cmdEl()
00148         {
00149                 return m_cmdEl;
00150         }
00151 }
00152