Really Warbler, it really just sounds like you have an incomplete impression of the Batman mythology. I know that may sound insulting, and I mean no offense. But if you haven't read The Dark Knight Returns...no wonder The Dark Knight Rises seems out of character. But in the mid-1980s---30 years ago, I might remind you--Frank Miller re-wrote the mythology. He recast it in an R-rated noir, where an aging Batman comes out of retirement to give his life to save Gotham from one last threat, eventually deciding to fake his death and let a young replacement, who briefly fought along side him, take over as Batman, with Wayne essentially retiring. Because Batman is a symbol when you get down to it, and Bruce Wayne's body no longer worked, he realized he could retire and move into a different role so long as there was someone worthy to take on the symbol as their identity.
That's a HUGE part of the modern Batman mythos. And it's not like it is recent, this was released even before Tim Burton's first film was made. The Dark Knight Returns is not only the best Batman graphic novel, it's one of the most important graphic novels ever made.
Saying it's outside the mythology for Batman to retire is like saying it's outside the mythology for Superman to be killed. It's a core element of the mythology as it currently stands. These storyline's have simply become part of the canon.
So, I guess, for you, your conception of Batman is that pre-modern, pre-80s view that wasn't so cynical, or so realistic for that matter. In the 1980s and early 1990s the Batman mythology evolved, just as Superman's did, and The Dark Knight Trilogy is essentially the result of this. Batman Begins is an adaptation of Batman Year One, by Frank Miller (1990s I think). Dark Knight is probably the most original of them all, because of Harvey Dent, but The Joker's inclusion shows a lot of influence from The Dark Knight Returns (1980s) by Frank Miller, in the way he is depicted. Finally, Dark Knight Rises takes the villain from Knightfall (1990s) where Bane breaks Batman, and grafts that injury onto the thematic plot of Frank Miller's Dark Knight Returns (1980s), where a battered Bruce Wayne comes out of retirement to save Gotham from a terrorist army, and decides to either die or retire and pass the mantle to a young kid named Robin.
The Dark Knight Trilogy, especially Dark Knight Rises is classic Batman, as faithfully as has ever been done. If it doesn't seem that way to you, it may very well be because you haven't kept up to date with the modern mythology of Batman. And fair enough. The 1990s Batman movies were more old fashioned in approach, the Nolan trilogy is the first feature take on the modern mythology.