class %(xml_entity)s(params.%(xml_entity)s, Base):
    def __init__(self, %(xml_entity_lc)s, context):
        Base.__init__(self, context)
        self.superclass = %(xml_entity_lc)s

%(fixme)s
    def __new__(cls, %(xml_entity_lc)s, context):
        if %(xml_entity_lc)s is None: return None
        obj = object.__new__(cls)
        obj.__init__(%(xml_entity_lc)s, context)
        return obj

    def __getProxy(self):
        proxy = context.manager[self.context].get('proxy')
        if proxy:
            return proxy
        #This may happen only if sdk was explicitly disconnected
        #using .disconnect() method, but resource instance ref. is
        #still available at client's code.
        raise DisconnectedError

