private void switchToNewModel(IContainerRootMarshalled c)
 {
     ContainerRoot cc = CloneContainerRoot(c);
     if (!c.isReadOnly())
     {
         cc = (ContainerRoot)kevoreeFactory.createModelCloner().clone(cc, true);
     }
     // current model is backed-up
     UUIDModel previousModel = model;
     if (previousModel != null)
     {
         models.AddLast(previousModel);
     }
     // TODO : MAGIC NUMBER ;-) , ONLY KEEP 10 PREVIOUS MODEL
     if (models.Count > 15)
     {
         models.RemoveFirst();
     }
     // Changes the current model by the new model
     if (cc != null)
     {
         UUIDModel uuidModel = new UUIDModelImpl(Guid.NewGuid(), new ContainerRootMarshalled(cc));
         this.model = uuidModel;
         // Fires the update to listeners
         modelListeners.notifyAllListener();
     }
 }
        private void checkBootstrapNode(IContainerRootMarshalled currentModel)
        {
            try
            {
                if (nodeInstance == null)
                {
                    IContainerNodeMarshalled foundNode = currentModel.findNodesByID(getNodeName());
                    if (foundNode != null)
                    {
                        nodeInstance = bootstrapNodeType(currentModel, getNodeName());
                        if (nodeInstance != null)
                        {
                            nodeInstance.Start();

                            UUIDModelImpl uuidModel = new UUIDModelImpl(Guid.NewGuid(), new ContainerRootMarshalled(kevoreeFactory.createContainerRoot()));

                            // TODO : check for concurrency problems here.
                            this.model = uuidModel;
                        }
                    }
                }
            }
            catch (java.lang.Throwable)
            {
                // TODO is it possible to display the following log ?
                try
                {
                    if (nodeInstance != null)
                    {
                        // TODO : Mieux gérer les erreurs
                        /*Method met = resolver.resolve(org.kevoree.annotation.Stop.class);
                        met.invoke(nodeInstance);
                         */
                    }
                }
                catch (java.lang.Throwable)
                {
                }
                finally
                {
                }
                nodeInstance = null;
               // resolver = null;
            }
        }